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

Method execute

include/pybind11/detail/init.h:350–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

348 enable_if_t<Class::has_alias && std::is_constructible<Alias<Class>, Args...>::value,
349 int> = 0>
350 static void execute(Class &cl, const Extra &...extra) {
351 cl.def(
352 "__init__",
353 [](value_and_holder &v_h, Args... args) {
354 v_h.value_ptr()
355 = construct_or_initialize<Alias<Class>>(std::forward<Args>(args)...);
356 },
357 is_new_style_constructor(),
358 extra...);
359 }
360};
361
362// Implementation class for py::init(Func) and py::init(Func, AliasFunc)

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected