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

View File

@ -1302,9 +1302,10 @@ public:
record.default_holder = holder_is_smart_holder; record.default_holder = holder_is_smart_holder;
#if 0 #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_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::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(!(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
#endif #endif
set_operator_new<type>(&record); set_operator_new<type>(&record);