Copying MSVC 2015 compatibility change from branch pr2672_use_smart_holder_as_default.

parent 794ecf6c
...@@ -1186,8 +1186,6 @@ public: ...@@ -1186,8 +1186,6 @@ public:
// clang-format on // clang-format on
struct smart_holder_type_caster_class_hooks { struct smart_holder_type_caster_class_hooks {
using is_smart_holder_type_caster = std::true_type;
static decltype(&modified_type_caster_generic_load_impl::local_load) static decltype(&modified_type_caster_generic_load_impl::local_load)
get_local_load_function_ptr() { get_local_load_function_ptr() {
return &modified_type_caster_generic_load_impl::local_load; return &modified_type_caster_generic_load_impl::local_load;
...@@ -2456,14 +2454,17 @@ template <typename T> using move_never = none_of<move_always<T>, move_if_unrefer ...@@ -2456,14 +2454,17 @@ template <typename T> using move_never = none_of<move_always<T>, move_if_unrefer
template <typename T, typename SFINAE = void> template <typename T, typename SFINAE = void>
struct is_smart_holder_type_caster : std::false_type {}; struct is_smart_holder_type_caster : std::false_type {};
template <typename T> template <typename T>
struct is_smart_holder_type_caster< struct is_smart_holder_type_caster<
T, T,
typename std::enable_if<type_caster<T>::is_smart_holder_type_caster::value, void>::type> : std::true_type {}; typename std::enable_if<
std::is_base_of<smart_holder_type_caster_class_hooks, make_caster<T>>::value>::type>
: std::true_type {};
template <typename T> template <typename T>
inline bool check_is_smart_holder_type_caster() { inline bool check_is_smart_holder_type_caster() {
return detail::is_smart_holder_type_caster<T>::value; return is_smart_holder_type_caster<T>::value;
} }
// Detect whether returning a `type` from a cast on type's type_caster is going to result in a // Detect whether returning a `type` from a cast on type's type_caster is going to result in a
......
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