Merge branch 'pybind:master' into master

This commit is contained in:
Steve R. Sun 2023-10-23 09:22:19 +08:00 committed by GitHub
commit 6b7cc9e5d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 6 deletions

View File

@ -195,9 +195,10 @@ jobs:
matrix: matrix:
include: include:
# TODO: Fails on 3.10, investigate # TODO: Fails on 3.10, investigate
- python-version: "3.9" # JOB DISABLED (NEEDS WORK): https://github.com/pybind/pybind11/issues/4889
python-debug: true # - python-version: "3.9"
valgrind: true # python-debug: true
# valgrind: true
- python-version: "3.11" - python-version: "3.11"
python-debug: false python-debug: false

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>