Working around MSVC 2015 bug (to be proven via GitHub CI).

parent 74382813
...@@ -1385,6 +1385,10 @@ struct smart_holder_type_caster : smart_holder_type_caster_load<T>, ...@@ -1385,6 +1385,10 @@ struct smart_holder_type_caster : smart_holder_type_caster_load<T>,
// clang-format off // clang-format off
#if defined(_MSC_VER) && _MSC_VER < 1910
// Working around MSVC 2015 bug.
template <typename T_> using cast_op_type = detail::cast_op_type<T_>;
#else
template <typename T_> template <typename T_>
using cast_op_type = conditional_t< using cast_op_type = conditional_t<
std::is_same<remove_reference_t<T_>, T const *>::value, std::is_same<remove_reference_t<T_>, T const *>::value,
...@@ -1394,6 +1398,7 @@ struct smart_holder_type_caster : smart_holder_type_caster_load<T>, ...@@ -1394,6 +1398,7 @@ struct smart_holder_type_caster : smart_holder_type_caster_load<T>,
conditional_t<std::is_same<T_, T const &>::value, conditional_t<std::is_same<T_, T const &>::value,
T const &, T const &,
T &>>>; T &>>>;
#endif
operator T const&() { return this->loaded_as_lvalue_ref(); } operator T const&() { return this->loaded_as_lvalue_ref(); }
operator T&() { return this->loaded_as_lvalue_ref(); } operator T&() { return this->loaded_as_lvalue_ref(); }
......
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