Go to the documentation of this file.
12 #define PYBIND11_VERSION_MAJOR 2
13 #define PYBIND11_VERSION_MINOR 13
14 #define PYBIND11_VERSION_PATCH 1
18 #define PYBIND11_VERSION_HEX 0x020D0100
31 # define PYBIND11_COMPILER_MSVC
32 # define PYBIND11_PRAGMA(...) __pragma(__VA_ARGS__)
33 # define PYBIND11_WARNING_PUSH PYBIND11_PRAGMA(warning(push))
34 # define PYBIND11_WARNING_POP PYBIND11_PRAGMA(warning(pop))
35 #elif defined(__INTEL_COMPILER)
36 # define PYBIND11_COMPILER_INTEL
37 # define PYBIND11_PRAGMA(...) _Pragma(#__VA_ARGS__)
38 # define PYBIND11_WARNING_PUSH PYBIND11_PRAGMA(warning push)
39 # define PYBIND11_WARNING_POP PYBIND11_PRAGMA(warning pop)
40 #elif defined(__clang__)
41 # define PYBIND11_COMPILER_CLANG
42 # define PYBIND11_PRAGMA(...) _Pragma(#__VA_ARGS__)
43 # define PYBIND11_WARNING_PUSH PYBIND11_PRAGMA(clang diagnostic push)
44 # define PYBIND11_WARNING_POP PYBIND11_PRAGMA(clang diagnostic push)
45 #elif defined(__GNUC__)
46 # define PYBIND11_COMPILER_GCC
47 # define PYBIND11_PRAGMA(...) _Pragma(#__VA_ARGS__)
48 # define PYBIND11_WARNING_PUSH PYBIND11_PRAGMA(GCC diagnostic push)
49 # define PYBIND11_WARNING_POP PYBIND11_PRAGMA(GCC diagnostic pop)
52 #ifdef PYBIND11_COMPILER_MSVC
53 # define PYBIND11_WARNING_DISABLE_MSVC(name) PYBIND11_PRAGMA(warning(disable : name))
55 # define PYBIND11_WARNING_DISABLE_MSVC(name)
58 #ifdef PYBIND11_COMPILER_CLANG
59 # define PYBIND11_WARNING_DISABLE_CLANG(name) PYBIND11_PRAGMA(clang diagnostic ignored name)
61 # define PYBIND11_WARNING_DISABLE_CLANG(name)
64 #ifdef PYBIND11_COMPILER_GCC
65 # define PYBIND11_WARNING_DISABLE_GCC(name) PYBIND11_PRAGMA(GCC diagnostic ignored name)
67 # define PYBIND11_WARNING_DISABLE_GCC(name)
70 #ifdef PYBIND11_COMPILER_INTEL
71 # define PYBIND11_WARNING_DISABLE_INTEL(name) PYBIND11_PRAGMA(warning disable name)
73 # define PYBIND11_WARNING_DISABLE_INTEL(name)
76 #define PYBIND11_NAMESPACE_BEGIN(name) \
80 #define PYBIND11_NAMESPACE_END(name) \
81 PYBIND11_WARNING_POP \
87 #if !defined(PYBIND11_NAMESPACE)
89 # define PYBIND11_NAMESPACE pybind11 __attribute__((visibility("hidden")))
91 # define PYBIND11_NAMESPACE pybind11
95 #if !(defined(_MSC_VER) && __cplusplus == 199711L)
96 # if __cplusplus >= 201402L
97 # define PYBIND11_CPP14
98 # if __cplusplus >= 201703L
99 # define PYBIND11_CPP17
100 # if __cplusplus >= 202002L
101 # define PYBIND11_CPP20
106 #elif defined(_MSC_VER) && __cplusplus == 199711L
110 # if _MSVC_LANG >= 201402L
111 # define PYBIND11_CPP14
112 # if _MSVC_LANG > 201402L
113 # define PYBIND11_CPP17
114 # if _MSVC_LANG >= 202002L
115 # define PYBIND11_CPP20
121 #if defined(PYBIND11_CPP20)
122 # define PYBIND11_CONSTINIT constinit
123 # define PYBIND11_DTOR_CONSTEXPR constexpr
125 # define PYBIND11_CONSTINIT
126 # define PYBIND11_DTOR_CONSTEXPR
130 #if defined(__INTEL_COMPILER)
131 # if __INTEL_COMPILER < 1800
132 # error pybind11 requires Intel C++ compiler v18 or newer
133 # elif __INTEL_COMPILER < 1900 && defined(PYBIND11_CPP14)
134 # error pybind11 supports only C++11 with Intel C++ compiler v18. Use v19 or newer for C++14.
138 # pragma warning disable 2196 // warning #2196: routine is both "inline" and "noinline"
139 #elif defined(__clang__) && !defined(__apple_build_version__)
140 # if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 3)
141 # error pybind11 requires clang 3.3 or newer
143 #elif defined(__clang__)
146 # if __clang_major__ < 5
147 # error pybind11 requires Xcode/clang 5.0 or newer
149 #elif defined(__GNUG__)
150 # if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8)
151 # error pybind11 requires gcc 4.8 or newer
153 #elif defined(_MSC_VER)
155 # error pybind11 2.10+ requires MSVC 2017 or newer
159 #if !defined(PYBIND11_EXPORT)
160 # if defined(WIN32) || defined(_WIN32)
161 # define PYBIND11_EXPORT __declspec(dllexport)
163 # define PYBIND11_EXPORT __attribute__((visibility("default")))
167 #if !defined(PYBIND11_EXPORT_EXCEPTION)
168 # if defined(__apple_build_version__)
169 # define PYBIND11_EXPORT_EXCEPTION PYBIND11_EXPORT
171 # define PYBIND11_EXPORT_EXCEPTION
181 #if !defined(PYBIND11_NOINLINE_FORCED) \
182 && (defined(__CUDACC__) || (defined(__GNUC__) && (__GNUC__ == 7 || __GNUC__ == 8)))
183 # define PYBIND11_NOINLINE_DISABLED
189 #if defined(PYBIND11_NOINLINE_DISABLED) // Option for maximum portability and experimentation.
190 # define PYBIND11_NOINLINE inline
191 #elif defined(_MSC_VER)
192 # define PYBIND11_NOINLINE __declspec(noinline) inline
194 # define PYBIND11_NOINLINE __attribute__((noinline)) inline
197 #if defined(__MINGW32__)
200 # define PYBIND11_DEPRECATED(reason)
201 #elif defined(PYBIND11_CPP14)
202 # define PYBIND11_DEPRECATED(reason) [[deprecated(reason)]]
204 # define PYBIND11_DEPRECATED(reason) __attribute__((deprecated(reason)))
207 #if defined(PYBIND11_CPP17)
208 # define PYBIND11_MAYBE_UNUSED [[maybe_unused]]
209 #elif defined(_MSC_VER) && !defined(__clang__)
210 # define PYBIND11_MAYBE_UNUSED
212 # define PYBIND11_MAYBE_UNUSED __attribute__((__unused__))
217 #if defined(_MSC_VER)
218 # define HAVE_SNPRINTF 1
222 #if defined(_MSC_VER)
223 PYBIND11_WARNING_PUSH
226 # if defined(_DEBUG) && !defined(Py_DEBUG)
232 # if _MSVC_STL_VERSION >= 143
233 # include <crtdefs.h>
235 # define PYBIND11_DEBUG_MARKER
241 #if defined(__STDC_LIB_EXT1__) && !defined(__STDC_WANT_LIB_EXT1__)
242 # define __STDC_WANT_LIB_EXT1__
247 # if defined(PYBIND11_CPP17) && __has_include(<optional>)
248 # define PYBIND11_HAS_OPTIONAL 1
251 # if defined(PYBIND11_CPP14) && (__has_include(<experimental/optional>) && \
252 !__has_include(<optional>))
253 # define PYBIND11_HAS_EXP_OPTIONAL 1
256 # if defined(PYBIND11_CPP17) && __has_include(<variant>)
257 # define PYBIND11_HAS_VARIANT 1
259 #elif defined(_MSC_VER) && defined(PYBIND11_CPP17)
260 # define PYBIND11_HAS_OPTIONAL 1
261 # define PYBIND11_HAS_VARIANT 1
264 #if defined(PYBIND11_CPP17)
265 # if defined(__has_include)
266 # if __has_include(<string_view>)
267 # define PYBIND11_HAS_STRING_VIEW
269 # elif defined(_MSC_VER)
270 # define PYBIND11_HAS_STRING_VIEW
275 #if PY_VERSION_HEX < 0x03070000
276 # error "PYTHON < 3.7 IS UNSUPPORTED. pybind11 v2.12 was the last to support Python 3.6."
278 #include <frameobject.h>
279 #include <pythread.h>
294 #if defined(copysign)
298 #if defined(PYBIND11_NUMPY_1_ONLY)
299 # define PYBIND11_INTERNAL_NUMPY_1_ONLY_DETECTED
302 #if defined(PYPY_VERSION) && !defined(PYBIND11_SIMPLE_GIL_MANAGEMENT)
303 # define PYBIND11_SIMPLE_GIL_MANAGEMENT
306 #if defined(_MSC_VER)
307 # if defined(PYBIND11_DEBUG_MARKER)
309 # undef PYBIND11_DEBUG_MARKER
317 #include <forward_list>
321 #include <type_traits>
323 #include <unordered_map>
324 #include <unordered_set>
326 #if defined(__has_include)
327 # if __has_include(<version>)
333 #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
334 # define PYBIND11_HAS_U8STRING
338 #if !defined(PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF) && !defined(NDEBUG) \
339 && !defined(PYPY_VERSION) && !defined(PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF)
340 # define PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF
357 #define PYBIND11_INSTANCE_METHOD_NEW(ptr, class_) PyInstanceMethod_New(ptr)
358 #define PYBIND11_INSTANCE_METHOD_CHECK PyInstanceMethod_Check
359 #define PYBIND11_INSTANCE_METHOD_GET_FUNCTION PyInstanceMethod_GET_FUNCTION
360 #define PYBIND11_BYTES_CHECK PyBytes_Check
361 #define PYBIND11_BYTES_FROM_STRING PyBytes_FromString
362 #define PYBIND11_BYTES_FROM_STRING_AND_SIZE PyBytes_FromStringAndSize
363 #define PYBIND11_BYTES_AS_STRING_AND_SIZE PyBytes_AsStringAndSize
364 #define PYBIND11_BYTES_AS_STRING PyBytes_AsString
365 #define PYBIND11_BYTES_SIZE PyBytes_Size
366 #define PYBIND11_LONG_CHECK(o) PyLong_Check(o)
367 #define PYBIND11_LONG_AS_LONGLONG(o) PyLong_AsLongLong(o)
368 #define PYBIND11_LONG_FROM_SIGNED(o) PyLong_FromSsize_t((ssize_t) (o))
369 #define PYBIND11_LONG_FROM_UNSIGNED(o) PyLong_FromSize_t((size_t) (o))
370 #define PYBIND11_BYTES_NAME "bytes"
371 #define PYBIND11_STRING_NAME "str"
372 #define PYBIND11_SLICE_OBJECT PyObject
373 #define PYBIND11_FROM_STRING PyUnicode_FromString
374 #define PYBIND11_STR_TYPE ::pybind11::str
375 #define PYBIND11_BOOL_ATTR "__bool__"
376 #define PYBIND11_NB_BOOL(ptr) ((ptr)->nb_bool)
377 #define PYBIND11_BUILTINS_MODULE "builtins"
380 #define PYBIND11_PLUGIN_IMPL(name) \
381 extern "C" PYBIND11_MAYBE_UNUSED PYBIND11_EXPORT PyObject *PyInit_##name(); \
382 extern "C" PYBIND11_EXPORT PyObject *PyInit_##name()
384 #define PYBIND11_TRY_NEXT_OVERLOAD ((PyObject *) 1) // special failure return code
385 #define PYBIND11_STRINGIFY(x) #x
386 #define PYBIND11_TOSTRING(x) PYBIND11_STRINGIFY(x)
387 #define PYBIND11_CONCAT(first, second) first##second
388 #define PYBIND11_ENSURE_INTERNALS_READY pybind11::detail::get_internals();
390 #define PYBIND11_CHECK_PYTHON_VERSION \
392 const char *compiled_ver \
393 = PYBIND11_TOSTRING(PY_MAJOR_VERSION) "." PYBIND11_TOSTRING(PY_MINOR_VERSION); \
394 const char *runtime_ver = Py_GetVersion(); \
395 size_t len = std::strlen(compiled_ver); \
396 if (std::strncmp(runtime_ver, compiled_ver, len) != 0 \
397 || (runtime_ver[len] >= '0' && runtime_ver[len] <= '9')) { \
398 PyErr_Format(PyExc_ImportError, \
399 "Python version mismatch: module was compiled for Python %s, " \
400 "but the interpreter version is incompatible: %s.", \
407 #define PYBIND11_CATCH_INIT_EXCEPTIONS \
408 catch (pybind11::error_already_set & e) { \
409 pybind11::raise_from(e, PyExc_ImportError, "initialization failed"); \
412 catch (const std::exception &e) { \
413 ::pybind11::set_error(PyExc_ImportError, e.what()); \
432 #define PYBIND11_PLUGIN(name) \
433 PYBIND11_DEPRECATED("PYBIND11_PLUGIN is deprecated, use PYBIND11_MODULE") \
434 static PyObject *pybind11_init(); \
435 PYBIND11_PLUGIN_IMPL(name) { \
436 PYBIND11_CHECK_PYTHON_VERSION \
437 PYBIND11_ENSURE_INTERNALS_READY \
439 return pybind11_init(); \
441 PYBIND11_CATCH_INIT_EXCEPTIONS \
443 PyObject *pybind11_init()
466 #define PYBIND11_MODULE(name, variable, ...) \
467 static ::pybind11::module_::module_def PYBIND11_CONCAT(pybind11_module_def_, name) \
468 PYBIND11_MAYBE_UNUSED; \
469 PYBIND11_MAYBE_UNUSED \
470 static void PYBIND11_CONCAT(pybind11_init_, name)(::pybind11::module_ &); \
471 PYBIND11_PLUGIN_IMPL(name) { \
472 PYBIND11_CHECK_PYTHON_VERSION \
473 PYBIND11_ENSURE_INTERNALS_READY \
474 auto m = ::pybind11::module_::create_extension_module( \
475 PYBIND11_TOSTRING(name), \
477 &PYBIND11_CONCAT(pybind11_module_def_, name), \
480 PYBIND11_CONCAT(pybind11_init_, name)(m); \
483 PYBIND11_CATCH_INIT_EXCEPTIONS \
485 void PYBIND11_CONCAT(pybind11_init_, name)(::pybind11::module_ & (variable))
490 using
size_t =
std::
size_t;
492 template <typename IntType>
494 static_assert(
sizeof(IntType) <=
sizeof(
ssize_t),
"Implicit narrowing is not permitted.");
495 return static_cast<ssize_t>(val);
552 inline static constexpr
int log2(
size_t n,
int k = 0) {
553 return (
n <= 1) ? k :
log2(
n >> 1, k + 1);
558 return 1 + ((
s - 1) >>
log2(
sizeof(
void *)));
568 static_assert(
sizeof(std::shared_ptr<int>) >=
sizeof(std::unique_ptr<int>),
569 "pybind assumes std::shared_ptrs are at least as big as std::unique_ptrs");
636 bool throw_if_missing =
true);
644 "Internal error: `pybind11::detail::instance` is not standard layout!");
647 #if defined(PYBIND11_CPP14)
653 template <
bool B,
typename T =
void>
655 template <
bool B,
typename T,
typename F>
657 template <
typename T>
659 template <
typename T>
663 #if defined(PYBIND11_CPP20)
664 using std::remove_cvref;
676 template <
typename T,
typename U>
680 #if defined(PYBIND11_CPP14)
681 using std::index_sequence;
686 template <
size_t N,
size_t...
S>
688 template <
size_t...
S>
697 template <
typename ISeq,
size_t,
bool...>
701 template <
size_t... IPrev,
size_t I,
bool B,
bool... Bs>
703 :
select_indices_impl<conditional_t<B, index_sequence<IPrev..., I>, index_sequence<IPrev...>>,
706 template <
bool... Bs>
712 template <
typename T>
718 #if defined(__PGIC__) || defined(__INTEL_COMPILER)
719 template <
typename...>
722 template <
typename...>
726 template <
typename... Ts>
731 #if defined(__cpp_fold_expressions) && !(defined(_MSC_VER) && (_MSC_VER < 1916))
732 template <
class... Ts>
734 template <
class... Ts>
736 #elif !defined(_MSC_VER)
739 template <
class... Ts>
741 template <
class... Ts>
746 template <
class... Ts>
747 using all_of = std::conjunction<Ts...>;
748 template <
class... Ts>
749 using any_of = std::disjunction<Ts...>;
751 template <
class... Ts>
754 template <
class T,
template <
class>
class... Predicates>
756 template <
class T,
template <
class>
class... Predicates>
758 template <
class T,
template <
class>
class... Predicates>
762 template <
typename T>
764 template <
typename C,
typename R,
typename...
A>
768 template <
typename C,
typename R,
typename...
A>
772 #ifdef __cpp_noexcept_function_type
773 template <
typename C,
typename R,
typename...
A>
777 template <
typename C,
typename R,
typename...
A>
782 template <
typename T>
787 template <
typename T>
791 template <
typename T>
795 template <
typename T>
799 template <
typename T>
803 template <
typename T,
size_t N>
807 template <
typename T,
size_t N>
811 template <
typename T>
818 template <
typename...>
822 #ifdef __cpp_fold_expressions
823 template <
typename... Ts>
825 return (0 + ... +
size_t{ns});
829 template <
typename T,
typename... Ts>
838 template <
typename T,
typename... Ts>
844 template <
typename T,
typename... Ts>
850 template <
template <
typename>
class Predicate,
typename... Ts>
858 template <
template <
typename>
class Predicate,
typename... Ts>
864 template <
size_t N,
typename T,
typename... Ts>
868 template <
typename T,
typename... Ts>
875 template <
template <
typename>
class Predicate,
typename Default,
typename... Ts>
878 static_assert(
found <= 1,
"Found more than one type matching the predicate");
883 template <
template <
typename>
class P,
typename Default>
888 template <
template <
typename>
class Predicate,
typename Default,
typename... Ts>
892 template <
typename T,
typename... >
896 template <
typename T,
typename... Us>
901 template <
typename Base,
typename Derived>
908 template <
typename Base,
typename Derived>
913 template <
template <
typename...>
class Base>
915 template <
typename... Us>
917 static std::false_type
check(...);
922 template <
template <
typename...>
class Base,
typename T>
925 #if !defined(_MSC_VER)
930 : decltype(is_template_base_of_impl<Base>::check((intrinsic_t<T> *) nullptr)){};
935 template <
template <
typename...>
class Class,
typename T>
937 template <
template <
typename...>
class Class,
typename... Us>
941 template <
typename T>
945 template <
typename T,
typename =
void>
947 template <
typename T>
949 void_t<decltype(*std::declval<T &>()), decltype(++std::declval<T &>())>>
952 template <
typename T>
957 template <
typename F>
967 template <
typename Function,
typename F = remove_reference_t<Function>>
972 std::remove_pointer<F>,
978 template <
typename T>
982 std::is_member_pointer>;
986 #if defined(__cpp_fold_expressions) && !defined(__INTEL_COMPILER)
988 # define PYBIND11_EXPAND_SIDE_EFFECTS(PATTERN) (((PATTERN), void()), ...)
991 # define PYBIND11_EXPAND_SIDE_EFFECTS(PATTERN) \
992 (void) pybind11::detail::expand_side_effects { ((PATTERN), void(), false)..., false }
1000 using std::runtime_error::runtime_error;
1005 #define PYBIND11_RUNTIME_EXCEPTION(name, type) \
1006 class PYBIND11_EXPORT_EXCEPTION name : public builtin_exception { \
1008 using builtin_exception::builtin_exception; \
1009 name() : name("") {} \
1010 void set_error() const override { PyErr_SetString(type, what()); } \
1027 assert(!PyErr_Occurred());
1028 throw std::runtime_error(
reason);
1031 assert(!PyErr_Occurred());
1032 throw std::runtime_error(
reason);
1035 template <
typename T,
typename SFINAE =
void>
1038 template <
typename T>
1042 static constexpr
const char c =
'O';
1043 static constexpr
const char value[2] = {
c,
'\0'};
1044 static std::string
format() {
return std::string(1,
c); }
1053 template <
typename T,
typename SFINAE =
void>
1057 template <
typename T>
1060 static constexpr
int index
1073 template <
typename T>
1075 static constexpr
const char c =
"?bBhHiIqQfdg"[detail::is_fmt_numeric<T>::index];
1076 static constexpr
const char value[2] = {
c,
'\0'};
1077 static std::string
format() {
return std::string(1,
c); }
1080 #if !defined(PYBIND11_CPP17)
1082 template <
typename T>
1083 constexpr
const char
1099 template <
typename T>
1104 template <
typename... Args>
1106 template <
typename Return>
1107 constexpr
auto operator()(Return (*pf)(Args...)) const noexcept -> decltype(pf) {
1111 template <
typename Return,
typename Class>
1113 std::false_type = {}) const noexcept -> decltype(pmf) {
1117 template <
typename Return,
typename Class>
1119 std::true_type)
const noexcept -> decltype(pmf) {
1126 #if defined(PYBIND11_CPP14)
1127 # define PYBIND11_OVERLOAD_CAST 1
1128 template <
typename... Args>
1132 static constexpr detail::overload_cast_impl<Args...>
overload_cast{};
1138 static constexpr
auto const_ = std::true_type{};
1140 #if !defined(PYBIND11_CPP14) // no overload_cast: providing something that static_assert-fails:
1141 template <
typename... Args>
1144 "pybind11::overload_cast<...> requires compiling in C++14 mode");
1146 #endif // overload_cast
1153 template <
typename T>
1166 template <
typename Container,
1168 std::is_convertible<decltype(*std::begin(std::declval<const Container &>())),
1184 operator std::vector<T> &&() && {
return std::move(
v); }
1198 template <
typename T>
1199 inline static std::shared_ptr<T>
1205 #if defined(__cpp_lib_enable_shared_from_this) && (!defined(_MSC_VER) || _MSC_VER >= 1912)
1206 return holder_value_ptr->weak_from_this().lock();
1209 return holder_value_ptr->shared_from_this();
1210 }
catch (
const std::bad_weak_ptr &) {
1217 template <
typename... Args>
1218 #if defined(_MSC_VER) && _MSC_VER < 1920 // MSVC 2017
1226 #if defined(_MSC_VER) && _MSC_VER <= 1916
1227 # define PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(...) \
1228 detail::silence_unused_warnings(__VA_ARGS__)
1230 # define PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(...)
1234 #if defined(__GNUG__) && !defined(__clang__) && !defined(__INTEL_COMPILER)
1235 # define PYBIND11_WORKAROUND_INCORRECT_GCC_UNUSED_BUT_SET_PARAMETER(...) \
1236 detail::silence_unused_warnings(__VA_ARGS__)
1238 # define PYBIND11_WORKAROUND_INCORRECT_GCC_UNUSED_BUT_SET_PARAMETER(...)
1241 #if defined(__clang__) \
1242 && (defined(__apple_build_version__)
1244 || (__clang_major__ >= 7 \
1245 && __clang_major__ <= 12) \
1247 # define PYBIND11_DETECTED_CLANG_WITH_MISLEADING_CALL_STD_MOVE_EXPLICITLY_WARNING
1263 #if !defined(PYBIND11_DETAILED_ERROR_MESSAGES) && !defined(NDEBUG)
1264 # define PYBIND11_DETAILED_ERROR_MESSAGES
typename select_indices_impl< index_sequence<>, 0, Bs... >::type select_indices
std::is_same< bools< Ts::value..., true >, bools< true, Ts::value... > > all_of
RAII wrapper that temporarily clears any Python error state.
bool[] expand_side_effects
Apply a function over each element of a parameter pack.
Return the Nth element from the parameter pack.
Matrix< SCALARB, Dynamic, Dynamic, opt_B > B
bool_constant< std::is_pointer< T >::value &&std::is_function< typename std::remove_pointer< T >::type >::value > is_function_pointer
error_scope & operator=(const error_scope &)=delete
typename remove_class< decltype(&F::operator())>::type type
Helper template to strip away type modifiers.
constexpr size_t instance_simple_holder_in_ptrs()
nonsimple_values_and_holders nonsimple
return_value_policy
Approach used to cast a previously unknown C++ instance into a Python object.
static constexpr auto found
const std::vector< T > * operator->() const
value_and_holder get_value_and_holder(const type_info *find_type=nullptr, bool throw_if_missing=true)
typename void_t_impl< Ts... >::type void_t
static constexpr uint8_t status_instance_registered
constexpr size_t constexpr_sum()
Compile-time integer sum.
any_container(It first, It last)
typename std::remove_cv< T >::type remove_cv_t
typename deferred_type< T, Us... >::type deferred_t
static constexpr auto const_
static std::shared_ptr< T > try_get_shared_from_this(std::enable_shared_from_this< T > *holder_value_ptr)
Strip the class from a method type.
PYBIND11_WARNING_PUSH PYBIND11_WARNING_POP
#define PYBIND11_NAMESPACE_END(name)
#define PYBIND11_NOINLINE
decltype(is_template_base_of_impl< Base >::check((intrinsic_t< T > *) nullptr)) is_template_base_of
Eigen::Triplet< double > T
Compile-time all/any/none of that check the boolean value of all template types.
void ** values_and_holders
#define PYBIND11_NAMESPACE_BEGIN(name)
static constexpr size_t size_in_ptrs(size_t s)
static constexpr int log2(size_t n, int k=0)
#define PYBIND11_WARNING_DISABLE_MSVC(name)
void * simple_value_holder[1+instance_simple_holder_in_ptrs()]
std::vector< T > * operator->()
std::string get_fully_qualified_tp_name(PyTypeObject *)
#define PYBIND11_RUNTIME_EXCEPTION(name, type)
typename std::conditional< B, T, F >::type conditional_t
Helper template which holds a list of types.
The 'instance' type which needs to be standard layout (need to be able to use 'offsetof')
conditional_t< found, typename pack_element< index, Ts... >::type, Default > type
all_of< Predicates< T >... > satisfies_all_of
static constexpr bool value
any_container(const Container &c)
typename exactly_one< Predicate, Default, Ts... >::type exactly_one_t
typename intrinsic_type< T >::type intrinsic_t
typename pack_element< N - 1, Ts... >::type type
#define PYBIND11_EXPORT_EXCEPTION
bool simple_instance_registered
For simple layout, tracks whether the instance is registered in registered_instances
void deallocate_layout()
Destroys/deallocates all of the above.
constexpr int first(int i)
Implementation details for constexpr functions.
typename remove_cvref< T >::type remove_cvref_t
std::vector< T > & operator*()
bool has_patients
If true, get_internals().patients has an entry for this object.
const std::vector< T > & operator*() const
static constexpr auto index
bool owned
If true, the pointer is owned which means we're free to manage it with a holder.
static constexpr uint8_t status_holder_constructed
Bit values for the non-simple status flags.
PyExc_RuntimeError PYBIND11_NOINLINE void pybind11_fail(const char *reason)
Used internally.
void set_error(const handle &type, const char *message)
void silence_unused_warnings(Args &&...)
std::is_same< detail::remove_cvref_t< T >, U > is_same_ignoring_cvref
Example usage: is_same_ignoring_cvref<T, PyObject *>::value.
Defer the evaluation of type T until types Us are instantiated.
std::integral_constant< bool, B > bool_constant
Backports of std::bool_constant and std::negation to accommodate older compilers.
constexpr int last(int, int result)
constexpr auto operator()(Return(*pf)(Args...)) const noexcept -> decltype(pf)
Matrix< Scalar, Dynamic, Dynamic > C
typename make_index_sequence_impl< N >::type make_index_sequence
conditional_t< std::is_function< F >::value, F, typename conditional_t< std::is_pointer< F >::value||std::is_member_pointer< F >::value, std::remove_pointer< F >, strip_function_object< F > >::type > function_signature_t
constexpr int constexpr_last()
Return the index of the last type in Ts which satisfies Predicate<T>, or -1 if none match.
bool_constant< std::is_base_of< Base, Derived >::value &&!std::is_same< Base, Derived >::value > is_strict_base_of
bool simple_holder_constructed
For simple layout, tracks whether the holder has been constructed.
ssize_t ssize_t_cast(const IntType &val)
Helper type to replace 'void' in some expressions.
any_container(const std::initializer_list< TIn > &c)
PyObject * weakrefs
Weak references.
bool_constant<(std::is_same< Base, Derived >::value||std::is_base_of< Base, Derived >::value) &&std::is_convertible< Derived *, Base * >::value > is_accessible_base_of
constexpr auto operator()(Return(Class::*pmf)(Args...), std::false_type={}) const noexcept -> decltype(pmf)
Array< int, Dynamic, 1 > v
Dummy destructor wrapper that can be used to expose classes with a private destructor.
Make an index sequence of the indices of true arguments.
static const EIGEN_DEPRECATED end_t end
C++ bindings of builtin Python exceptions.
constexpr int constexpr_first()
any_container(std::vector< T > &&v)
typename std::enable_if< B, T >::type enable_if_t
from cpp_future import (convenient aliases from C++14/17)
static std::true_type check(Base< Us... > *)
Rot2 R(Rot2::fromAngle(0.1))
typename std::remove_reference< T >::type remove_reference_t
constexpr auto operator()(Return(Class::*pmf)(Args...) const, std::true_type) const noexcept -> decltype(pmf)
remove_cv_t< remove_reference_t< T > > type
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:01:59