mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-11 16:13:53 +00:00
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:
parent
97e41de4e2
commit
bfe36cc7df
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user