Skip to content

Commit a5e6e01

Browse files
committed
Disable new static_assert if PYBIND11_RUN_TESTING_WITH_SMART_HOLDER_AS_DEFAULT_BUT_NEVER_USE_IN_PRODUCTION_PLEASE is defined.
1 parent 3863958 commit a5e6e01

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/pybind11/pybind11.h

+2
Original file line numberDiff line numberDiff line change
@@ -1985,11 +1985,13 @@ class class_ : public detail::generic_type {
19851985
static_assert(!has_alias || std::is_polymorphic<type>::value,
19861986
"Cannot use an alias class (aka trampoline) with a non-polymorphic type");
19871987

1988+
#ifndef PYBIND11_RUN_TESTING_WITH_SMART_HOLDER_AS_DEFAULT_BUT_NEVER_USE_IN_PRODUCTION_PLEASE
19881989
static_assert(!has_alias || !detail::is_smart_holder<holder_type>::value
19891990
|| std::is_base_of<trampoline_self_life_support, type_alias>::value,
19901991
"Alias class (aka trampoline) must inherit from"
19911992
" pybind11::trampoline_self_life_support if used in combination with"
19921993
" pybind11::smart_holder");
1994+
#endif
19931995
static_assert(!has_alias || detail::is_smart_holder<holder_type>::value
19941996
|| !std::is_base_of<trampoline_self_life_support, type_alias>::value,
19951997
"pybind11::trampoline_self_life_support is a smart_holder feature, therefore"

0 commit comments

Comments
 (0)