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

Function construct_or_initialize

include/pybind11/detail/init.h:76–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74 typename... Args,
75 detail::enable_if_t<std::is_constructible<Class, Args...>::value, int> = 0>
76inline Class *construct_or_initialize(Args &&...args) {
77 return new Class(std::forward<Args>(args)...);
78}
79template <typename Class,
80 typename... Args,
81 detail::enable_if_t<!std::is_constructible<Class, Args...>::value, int> = 0>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected