MCPcopy Create free account
hub / github.com/pybind/pybind11 / init_instance

Method init_instance

include/pybind11/pybind11.h:2765–2772  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2763 template <typename H = holder_type,
2764 detail::enable_if_t<!detail::is_smart_holder<H>::value, int> = 0>
2765 static void init_instance(detail::instance *inst, const void *holder_ptr) {
2766 auto v_h = inst->get_value_and_holder(detail::get_type_info(typeid(type)));
2767 if (!v_h.instance_registered()) {
2768 register_instance(inst, v_h.value_ptr(), v_h.type);
2769 v_h.set_instance_registered();
2770 }
2771 init_holder(inst, v_h, (const holder_type *) holder_ptr, v_h.value_ptr<type>());
2772 }
2773
2774 template <typename WrappedType>
2775 static bool try_initialization_using_shared_from_this(holder_type *, WrappedType *, ...) {

Callers 6

dispatcherMethod · 0.80
constructFunction · 0.80
castMethod · 0.80

Calls 6

register_instanceFunction · 0.85
moveFunction · 0.85
get_value_and_holderMethod · 0.80
instance_registeredMethod · 0.80

Tested by

no test coverage detected