DEBUGGING_MSVC_2015: simplification (from compiler perspective) of struct…

DEBUGGING_MSVC_2015: simplification (from compiler perspective) of struct is_smart_holder_type_caster implementation.
parent a6c6fd8d
......@@ -2459,11 +2459,11 @@ template <typename T> struct move_if_unreferenced<T, enable_if_t<all_of<
template <typename T> using move_never = none_of<move_always<T>, move_if_unreferenced<T>>;
template <typename T, typename SFINAE = void>
struct is_smart_holder_type_caster : std::false_type {};
struct is_smart_holder_type_caster { static constexpr bool value = false; };
template <typename T>
struct is_smart_holder_type_caster<
T,
typename std::enable_if<type_caster<T>::is_smart_holder_type_caster::value, void>::type> : std::true_type {};
typename std::enable_if<type_caster<T>::is_smart_holder_type_caster::value, void>::type> { static constexpr bool value = true; };
template <typename T>
inline bool check_is_smart_holder_type_caster() {
......
......@@ -1286,10 +1286,10 @@ public:
none_of<std::is_same<multiple_inheritance, Extra>...>::value), // no multiple_inheritance attr
"Error: multiple inheritance bases must be specified via class_ template options");
# if 0
static constexpr bool holder_is_smart_holder = std::is_same<holder_type, smart_holder>::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;
# if 0
// Necessary conditions, but not strict.
static_assert(!(detail::is_instantiation<std::unique_ptr, holder_type>::value &&
type_caster_type_is_smart_holder_type_caster),
......@@ -1302,7 +1302,6 @@ public:
static_assert(!(holder_is_smart_holder && type_caster_type_is_type_caster_base_subtype),
"py::class_ holder vs type_caster mismatch:"
" missing PYBIND11_SMART_HOLDER_TYPE_CASTERS(T)?");
#endif
#ifdef PYBIND11_STRICT_ASSERTS_CLASS_HOLDER_VS_TYPE_CASTER_MIX
// Strict conditions cannot be enforced universally at the moment (PR #2836).
static_assert(holder_is_smart_holder == type_caster_type_is_smart_holder_type_caster,
......@@ -1314,6 +1313,7 @@ public:
" missing PYBIND11_SMART_POINTER_HOLDER_TYPE_CASTERS(T, ...)"
" or collision with custom py::detail::type_caster<T>?");
#endif
#endif
type_record record;
record.scope = scope;
record.name = name;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment