Softening static_assert, to only check specifically that smart_holder is not mixed with type_caster_base, and unique_ptr/shared_ptr holders are not mixed with smart_holder_type_casters.

This commit is contained in:
Ralf W. Grosse-Kunstleve 2021-02-04 22:30:11 -08:00
parent 97e41de4e2
commit bfe36cc7df
1 changed files with 2 additions and 1 deletions

View File

@ -1302,9 +1302,10 @@ public:
record.default_holder = holder_is_smart_holder;
#if 0
static constexpr bool type_caster_type_is_smart_holder_type_caster = detail::is_smart_holder_type_caster<type>::value;
static constexpr bool type_caster_type_is_type_caster_base_subtype = std::is_base_of<detail::type_caster_base<type>, detail::type_caster<type>>::value;
static_assert(!(detail::is_instantiation<std::unique_ptr, holder_type>::value && type_caster_type_is_smart_holder_type_caster));
static_assert(!(detail::is_instantiation<std::shared_ptr, holder_type>::value && type_caster_type_is_smart_holder_type_caster));
static_assert(holder_is_smart_holder == type_caster_type_is_smart_holder_type_caster);
static_assert(!(holder_is_smart_holder && type_caster_type_is_type_caster_base_subtype));
#endif
#endif
set_operator_new<type>(&record);