From fc5d70da29df2d9e78f2fc906becf2a341790c02 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Wed, 27 Oct 2021 09:47:01 -0700 Subject: [PATCH] return_value_policy_override fix: also enable for type_uses_smart_holder_type_caster --- include/pybind11/cast.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h index 6c5df2299..dd19a74e6 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -895,7 +895,9 @@ template struct return_value_policy_ov }; template struct return_value_policy_override>::value, void>> { + detail::enable_if_t< + std::is_base_of>::value || + type_uses_smart_holder_type_caster>::value, void>> { static return_value_policy policy(return_value_policy p) { return !std::is_lvalue_reference::value && !std::is_pointer::value