Merge branch 'master' into annotated_any

This commit is contained in:
Ralf W. Grosse-Kunstleve 2023-10-21 11:05:07 -07:00
commit 90b3912b9f

View File

@ -42,13 +42,15 @@ using make_caster = type_caster<intrinsic_t<type>>;
// Shortcut for calling a caster's `cast_op_type` cast operator for casting a type_caster to a T // Shortcut for calling a caster's `cast_op_type` cast operator for casting a type_caster to a T
template <typename T> template <typename T>
typename make_caster<T>::template cast_op_type<T> cast_op(make_caster<T> &caster) { typename make_caster<T>::template cast_op_type<T> cast_op(make_caster<T> &caster) {
return caster.operator typename make_caster<T>::template cast_op_type<T>(); using result_t = typename make_caster<T>::template cast_op_type<T>; // See PR #4893
return caster.operator result_t();
} }
template <typename T> template <typename T>
typename make_caster<T>::template cast_op_type<typename std::add_rvalue_reference<T>::type> typename make_caster<T>::template cast_op_type<typename std::add_rvalue_reference<T>::type>
cast_op(make_caster<T> &&caster) { cast_op(make_caster<T> &&caster) {
return std::move(caster).operator typename make_caster<T>:: using result_t = typename make_caster<T>::template cast_op_type<
template cast_op_type<typename std::add_rvalue_reference<T>::type>(); typename std::add_rvalue_reference<T>::type>; // See PR #4893
return std::move(caster).operator result_t();
} }
template <typename type> template <typename type>