Go to the documentation of this file.
12 #define PYBIND11_VERSION_MAJOR 2
13 #define PYBIND11_VERSION_MINOR 11
14 #define PYBIND11_VERSION_PATCH 1
18 #define PYBIND11_VERSION_HEX 0x020B0100
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
122 #if defined(__INTEL_COMPILER)
123 # if __INTEL_COMPILER < 1800
124 # error pybind11 requires Intel C++ compiler v18 or newer
125 # elif __INTEL_COMPILER < 1900 && defined(PYBIND11_CPP14)
126 # error pybind11 supports only C++11 with Intel C++ compiler v18. Use v19 or newer for C++14.
130 # pragma warning disable 2196 // warning #2196: routine is both "inline" and "noinline"
131 #elif defined(__clang__) && !defined(__apple_build_version__)
132 # if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 3)
133 # error pybind11 requires clang 3.3 or newer
135 #elif defined(__clang__)
138 # if __clang_major__ < 5
139 # error pybind11 requires Xcode/clang 5.0 or newer
141 #elif defined(__GNUG__)
142 # if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8)
143 # error pybind11 requires gcc 4.8 or newer
145 #elif defined(_MSC_VER)
147 # error pybind11 2.10+ requires MSVC 2017 or newer
151 #if !defined(PYBIND11_EXPORT)
152 # if defined(WIN32) || defined(_WIN32)
153 # define PYBIND11_EXPORT __declspec(dllexport)
155 # define PYBIND11_EXPORT __attribute__((visibility("default")))
159 #if !defined(PYBIND11_EXPORT_EXCEPTION)
160 # if defined(__apple_build_version__)
161 # define PYBIND11_EXPORT_EXCEPTION PYBIND11_EXPORT
163 # define PYBIND11_EXPORT_EXCEPTION
173 #if !defined(PYBIND11_NOINLINE_FORCED) \
174 && (defined(__CUDACC__) || (defined(__GNUC__) && (__GNUC__ == 7 || __GNUC__ == 8)))
175 # define PYBIND11_NOINLINE_DISABLED
181 #if defined(PYBIND11_NOINLINE_DISABLED) // Option for maximum portability and experimentation.
182 # define PYBIND11_NOINLINE inline
183 #elif defined(_MSC_VER)
184 # define PYBIND11_NOINLINE __declspec(noinline) inline
186 # define PYBIND11_NOINLINE __attribute__((noinline)) inline
189 #if defined(__MINGW32__)
192 # define PYBIND11_DEPRECATED(reason)
193 #elif defined(PYBIND11_CPP14)
194 # define PYBIND11_DEPRECATED(reason) [[deprecated(reason)]]
196 # define PYBIND11_DEPRECATED(reason) __attribute__((deprecated(reason)))
199 #if defined(PYBIND11_CPP17)
200 # define PYBIND11_MAYBE_UNUSED [[maybe_unused]]
201 #elif defined(_MSC_VER) && !defined(__clang__)
202 # define PYBIND11_MAYBE_UNUSED
204 # define PYBIND11_MAYBE_UNUSED __attribute__((__unused__))
209 #if defined(_MSC_VER)
210 # define HAVE_SNPRINTF 1
214 #if defined(_MSC_VER)
215 PYBIND11_WARNING_PUSH
218 # if defined(_DEBUG) && !defined(Py_DEBUG)
224 # if _MSVC_STL_VERSION >= 143
225 # include <crtdefs.h>
227 # define PYBIND11_DEBUG_MARKER
233 #if defined(__STDC_LIB_EXT1__) && !defined(__STDC_WANT_LIB_EXT1__)
234 # define __STDC_WANT_LIB_EXT1__
239 # if defined(PYBIND11_CPP17) && __has_include(<optional>)
240 # define PYBIND11_HAS_OPTIONAL 1
243 # if defined(PYBIND11_CPP14) && (__has_include(<experimental/optional>) && \
244 !__has_include(<optional>))
245 # define PYBIND11_HAS_EXP_OPTIONAL 1
248 # if defined(PYBIND11_CPP17) && __has_include(<variant>)
249 # define PYBIND11_HAS_VARIANT 1
251 #elif defined(_MSC_VER) && defined(PYBIND11_CPP17)
252 # define PYBIND11_HAS_OPTIONAL 1
253 # define PYBIND11_HAS_VARIANT 1
256 #if defined(PYBIND11_CPP17)
257 # if defined(__has_include)
258 # if __has_include(<string_view>)
259 # define PYBIND11_HAS_STRING_VIEW
261 # elif defined(_MSC_VER)
262 # define PYBIND11_HAS_STRING_VIEW
268 #if PY_VERSION_HEX < 0x03060000
269 # error "PYTHON < 3.6 IS UNSUPPORTED. pybind11 v2.9 was the last to support Python 2 and 3.5."
271 #include <frameobject.h>
272 #include <pythread.h>
287 #if defined(copysign)
291 #if defined(PYPY_VERSION) && !defined(PYBIND11_SIMPLE_GIL_MANAGEMENT)
292 # define PYBIND11_SIMPLE_GIL_MANAGEMENT
295 #if defined(_MSC_VER)
296 # if defined(PYBIND11_DEBUG_MARKER)
298 # undef PYBIND11_DEBUG_MARKER
306 #include <forward_list>
310 #include <type_traits>
312 #include <unordered_map>
313 #include <unordered_set>
315 #if defined(__has_include)
316 # if __has_include(<version>)
322 #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
323 # define PYBIND11_HAS_U8STRING
327 #if !defined(PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF) && !defined(NDEBUG) \
328 && !defined(PYPY_VERSION) && !defined(PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF)
329 # define PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF
346 #define PYBIND11_INSTANCE_METHOD_NEW(ptr, class_) PyInstanceMethod_New(ptr)
347 #define PYBIND11_INSTANCE_METHOD_CHECK PyInstanceMethod_Check
348 #define PYBIND11_INSTANCE_METHOD_GET_FUNCTION PyInstanceMethod_GET_FUNCTION
349 #define PYBIND11_BYTES_CHECK PyBytes_Check
350 #define PYBIND11_BYTES_FROM_STRING PyBytes_FromString
351 #define PYBIND11_BYTES_FROM_STRING_AND_SIZE PyBytes_FromStringAndSize
352 #define PYBIND11_BYTES_AS_STRING_AND_SIZE PyBytes_AsStringAndSize
353 #define PYBIND11_BYTES_AS_STRING PyBytes_AsString
354 #define PYBIND11_BYTES_SIZE PyBytes_Size
355 #define PYBIND11_LONG_CHECK(o) PyLong_Check(o)
356 #define PYBIND11_LONG_AS_LONGLONG(o) PyLong_AsLongLong(o)
357 #define PYBIND11_LONG_FROM_SIGNED(o) PyLong_FromSsize_t((ssize_t) (o))
358 #define PYBIND11_LONG_FROM_UNSIGNED(o) PyLong_FromSize_t((size_t) (o))
359 #define PYBIND11_BYTES_NAME "bytes"
360 #define PYBIND11_STRING_NAME "str"
361 #define PYBIND11_SLICE_OBJECT PyObject
362 #define PYBIND11_FROM_STRING PyUnicode_FromString
363 #define PYBIND11_STR_TYPE ::pybind11::str
364 #define PYBIND11_BOOL_ATTR "__bool__"
365 #define PYBIND11_NB_BOOL(ptr) ((ptr)->nb_bool)
366 #define PYBIND11_BUILTINS_MODULE "builtins"
369 #define PYBIND11_PLUGIN_IMPL(name) \
370 extern "C" PYBIND11_MAYBE_UNUSED PYBIND11_EXPORT PyObject *PyInit_##name(); \
371 extern "C" PYBIND11_EXPORT PyObject *PyInit_##name()
373 #define PYBIND11_TRY_NEXT_OVERLOAD ((PyObject *) 1) // special failure return code
374 #define PYBIND11_STRINGIFY(x) #x
375 #define PYBIND11_TOSTRING(x) PYBIND11_STRINGIFY(x)
376 #define PYBIND11_CONCAT(first, second) first##second
377 #define PYBIND11_ENSURE_INTERNALS_READY pybind11::detail::get_internals();
379 #define PYBIND11_CHECK_PYTHON_VERSION \
381 const char *compiled_ver \
382 = PYBIND11_TOSTRING(PY_MAJOR_VERSION) "." PYBIND11_TOSTRING(PY_MINOR_VERSION); \
383 const char *runtime_ver = Py_GetVersion(); \
384 size_t len = std::strlen(compiled_ver); \
385 if (std::strncmp(runtime_ver, compiled_ver, len) != 0 \
386 || (runtime_ver[len] >= '0' && runtime_ver[len] <= '9')) { \
387 PyErr_Format(PyExc_ImportError, \
388 "Python version mismatch: module was compiled for Python %s, " \
389 "but the interpreter version is incompatible: %s.", \
396 #define PYBIND11_CATCH_INIT_EXCEPTIONS \
397 catch (pybind11::error_already_set & e) { \
398 pybind11::raise_from(e, PyExc_ImportError, "initialization failed"); \
401 catch (const std::exception &e) { \
402 PyErr_SetString(PyExc_ImportError, e.what()); \
421 #define PYBIND11_PLUGIN(name) \
422 PYBIND11_DEPRECATED("PYBIND11_PLUGIN is deprecated, use PYBIND11_MODULE") \
423 static PyObject *pybind11_init(); \
424 PYBIND11_PLUGIN_IMPL(name) { \
425 PYBIND11_CHECK_PYTHON_VERSION \
426 PYBIND11_ENSURE_INTERNALS_READY \
428 return pybind11_init(); \
430 PYBIND11_CATCH_INIT_EXCEPTIONS \
432 PyObject *pybind11_init()
455 #define PYBIND11_MODULE(name, variable) \
456 static ::pybind11::module_::module_def PYBIND11_CONCAT(pybind11_module_def_, name) \
457 PYBIND11_MAYBE_UNUSED; \
458 PYBIND11_MAYBE_UNUSED \
459 static void PYBIND11_CONCAT(pybind11_init_, name)(::pybind11::module_ &); \
460 PYBIND11_PLUGIN_IMPL(name) { \
461 PYBIND11_CHECK_PYTHON_VERSION \
462 PYBIND11_ENSURE_INTERNALS_READY \
463 auto m = ::pybind11::module_::create_extension_module( \
464 PYBIND11_TOSTRING(name), nullptr, &PYBIND11_CONCAT(pybind11_module_def_, name)); \
466 PYBIND11_CONCAT(pybind11_init_, name)(m); \
469 PYBIND11_CATCH_INIT_EXCEPTIONS \
471 void PYBIND11_CONCAT(pybind11_init_, name)(::pybind11::module_ & (variable))
476 using
size_t =
std::
size_t;
478 template <typename IntType>
480 static_assert(
sizeof(IntType) <=
sizeof(
ssize_t),
"Implicit narrowing is not permitted.");
481 return static_cast<ssize_t>(val);
538 inline static constexpr
int log2(
size_t n,
int k = 0) {
539 return (
n <= 1) ? k :
log2(
n >> 1, k + 1);
544 return 1 + ((
s - 1) >>
log2(
sizeof(
void *)));
554 static_assert(
sizeof(std::shared_ptr<int>) >=
sizeof(std::unique_ptr<int>),
555 "pybind assumes std::shared_ptrs are at least as big as std::unique_ptrs");
622 bool throw_if_missing =
true);
630 "Internal error: `pybind11::detail::instance` is not standard layout!");
633 #if defined(PYBIND11_CPP14)
639 template <
bool B,
typename T =
void>
641 template <
bool B,
typename T,
typename F>
643 template <
typename T>
645 template <
typename T>
649 #if defined(PYBIND11_CPP20)
650 using std::remove_cvref;
662 template <
typename T,
typename U>
666 #if defined(PYBIND11_CPP14)
667 using std::index_sequence;
672 template <
size_t N,
size_t...
S>
674 template <
size_t...
S>
683 template <
typename ISeq,
size_t,
bool...>
687 template <
size_t... IPrev,
size_t I,
bool B,
bool... Bs>
689 :
select_indices_impl<conditional_t<B, index_sequence<IPrev..., I>, index_sequence<IPrev...>>,
692 template <
bool... Bs>
698 template <
typename T>
704 #if defined(__PGIC__) || defined(__INTEL_COMPILER)
705 template <
typename...>
708 template <
typename...>
712 template <
typename... Ts>
717 #if defined(__cpp_fold_expressions) && !(defined(_MSC_VER) && (_MSC_VER < 1916))
718 template <
class... Ts>
720 template <
class... Ts>
722 #elif !defined(_MSC_VER)
725 template <
class... Ts>
727 template <
class... Ts>
732 template <
class... Ts>
733 using all_of = std::conjunction<Ts...>;
734 template <
class... Ts>
735 using any_of = std::disjunction<Ts...>;
737 template <
class... Ts>
740 template <
class T,
template <
class>
class... Predicates>
742 template <
class T,
template <
class>
class... Predicates>
744 template <
class T,
template <
class>
class... Predicates>
748 template <
typename T>
750 template <
typename C,
typename R,
typename...
A>
754 template <
typename C,
typename R,
typename...
A>
758 #ifdef __cpp_noexcept_function_type
759 template <
typename C,
typename R,
typename...
A>
763 template <
typename C,
typename R,
typename...
A>
768 template <
typename T>
773 template <
typename T>
777 template <
typename T>
781 template <
typename T>
785 template <
typename T>
789 template <
typename T,
size_t N>
793 template <
typename T,
size_t N>
797 template <
typename T>
804 template <
typename...>
808 #ifdef __cpp_fold_expressions
809 template <
typename... Ts>
811 return (0 + ... +
size_t{ns});
815 template <
typename T,
typename... Ts>
824 template <
typename T,
typename... Ts>
830 template <
typename T,
typename... Ts>
836 template <
template <
typename>
class Predicate,
typename... Ts>
844 template <
template <
typename>
class Predicate,
typename... Ts>
850 template <
size_t N,
typename T,
typename... Ts>
854 template <
typename T,
typename... Ts>
861 template <
template <
typename>
class Predicate,
typename Default,
typename... Ts>
864 static_assert(
found <= 1,
"Found more than one type matching the predicate");
869 template <
template <
typename>
class P,
typename Default>
874 template <
template <
typename>
class Predicate,
typename Default,
typename... Ts>
878 template <
typename T,
typename... >
882 template <
typename T,
typename... Us>
887 template <
typename Base,
typename Derived>
894 template <
typename Base,
typename Derived>
899 template <
template <
typename...>
class Base>
901 template <
typename... Us>
903 static std::false_type
check(...);
908 template <
template <
typename...>
class Base,
typename T>
911 #if !defined(_MSC_VER)
916 : decltype(is_template_base_of_impl<Base>::check((intrinsic_t<T> *) nullptr)) {
922 template <
template <
typename...>
class Class,
typename T>
924 template <
template <
typename...>
class Class,
typename... Us>
928 template <
typename T>
932 template <
typename T,
typename =
void>
934 template <
typename T>
936 void_t<decltype(*std::declval<T &>()), decltype(++std::declval<T &>())>>
939 template <
typename T>
944 template <
typename F>
954 template <
typename Function,
typename F = remove_reference_t<Function>>
959 std::remove_pointer<F>,
965 template <
typename T>
969 std::is_member_pointer>;
973 #if defined(__cpp_fold_expressions) && !defined(__INTEL_COMPILER)
975 # define PYBIND11_EXPAND_SIDE_EFFECTS(PATTERN) (((PATTERN), void()), ...)
978 # define PYBIND11_EXPAND_SIDE_EFFECTS(PATTERN) \
979 (void) pybind11::detail::expand_side_effects { ((PATTERN), void(), false)..., false }
987 using std::runtime_error::runtime_error;
989 virtual void set_error()
const = 0;
992 #define PYBIND11_RUNTIME_EXCEPTION(name, type) \
993 class PYBIND11_EXPORT_EXCEPTION name : public builtin_exception { \
995 using builtin_exception::builtin_exception; \
996 name() : name("") {} \
997 void set_error() const override { PyErr_SetString(type, what()); } \
1014 assert(!PyErr_Occurred());
1015 throw std::runtime_error(
reason);
1018 assert(!PyErr_Occurred());
1019 throw std::runtime_error(
reason);
1022 template <
typename T,
typename SFINAE =
void>
1025 template <
typename T>
1029 static constexpr
const char c =
'O';
1030 static constexpr
const char value[2] = {
c,
'\0'};
1031 static std::string
format() {
return std::string(1,
c); }
1040 template <
typename T,
typename SFINAE =
void>
1044 template <
typename T>
1047 static constexpr
int index
1060 template <
typename T>
1062 static constexpr
const char c =
"?bBhHiIqQfdg"[detail::is_fmt_numeric<T>::index];
1063 static constexpr
const char value[2] = {
c,
'\0'};
1064 static std::string
format() {
return std::string(1,
c); }
1067 #if !defined(PYBIND11_CPP17)
1069 template <
typename T>
1070 constexpr
const char
1086 template <
typename T>
1091 template <
typename... Args>
1093 template <
typename Return>
1094 constexpr
auto operator()(Return (*pf)(Args...)) const noexcept -> decltype(pf) {
1098 template <
typename Return,
typename Class>
1099 constexpr
auto operator()(Return (
Class::*pmf)(Args...), std::false_type = {}) const noexcept
1104 template <
typename Return,
typename Class>
1105 constexpr
auto operator()(Return (
Class::*pmf)(Args...)
const, std::true_type)
const noexcept
1113 #if defined(PYBIND11_CPP14)
1114 # define PYBIND11_OVERLOAD_CAST 1
1115 template <
typename... Args>
1119 static constexpr detail::overload_cast_impl<Args...>
overload_cast{};
1125 static constexpr
auto const_ = std::true_type{};
1127 #if !defined(PYBIND11_CPP14) // no overload_cast: providing something that static_assert-fails:
1128 template <
typename... Args>
1131 "pybind11::overload_cast<...> requires compiling in C++14 mode");
1133 #endif // overload_cast
1140 template <
typename T>
1153 template <
typename Container,
1155 std::is_convertible<decltype(*std::begin(std::declval<const Container &>())),
1171 operator std::vector<T> &&() && {
return std::move(
v); }
1185 template <
typename T>
1186 inline static std::shared_ptr<T>
1192 #if defined(__cpp_lib_enable_shared_from_this) && (!defined(_MSC_VER) || _MSC_VER >= 1912)
1193 return holder_value_ptr->weak_from_this().lock();
1196 return holder_value_ptr->shared_from_this();
1197 }
catch (
const std::bad_weak_ptr &) {
1204 template <
typename... Args>
1205 #if defined(_MSC_VER) && _MSC_VER < 1920 // MSVC 2017
1213 #if defined(_MSC_VER) && _MSC_VER <= 1916
1214 # define PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(...) \
1215 detail::silence_unused_warnings(__VA_ARGS__)
1217 # define PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(...)
1221 #if defined(__GNUG__) && !defined(__clang__) && !defined(__INTEL_COMPILER)
1222 # define PYBIND11_WORKAROUND_INCORRECT_GCC_UNUSED_BUT_SET_PARAMETER(...) \
1223 detail::silence_unused_warnings(__VA_ARGS__)
1225 # define PYBIND11_WORKAROUND_INCORRECT_GCC_UNUSED_BUT_SET_PARAMETER(...)
1228 #if defined(__clang__) \
1229 && (defined(__apple_build_version__)
1231 || (__clang_major__ >= 7 \
1232 && __clang_major__ <= 12) \
1234 # define PYBIND11_DETECTED_CLANG_WITH_MISLEADING_CALL_STD_MOVE_EXPLICITLY_WARNING
1250 #if !defined(PYBIND11_DETAILED_ERROR_MESSAGES) && !defined(NDEBUG)
1251 # 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 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 Wed May 15 2024 15:17:55