Skip to content

Commit

Permalink
return_value_policy_override fix: also enable for type_uses_smart_hol…
Browse files Browse the repository at this point in the history
…der_type_caster
  • Loading branch information
Ralf W. Grosse-Kunstleve committed Oct 27, 2021
1 parent 50a4ed2 commit fc5d70d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/pybind11/cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,9 @@ template <typename Return, typename SFINAE = void> struct return_value_policy_ov
};

template <typename Return> struct return_value_policy_override<Return,
detail::enable_if_t<std::is_base_of<type_caster_generic, make_caster<Return>>::value, void>> {
detail::enable_if_t<
std::is_base_of<type_caster_generic, make_caster<Return>>::value ||
type_uses_smart_holder_type_caster<intrinsic_t<Return>>::value, void>> {
static return_value_policy policy(return_value_policy p) {
return !std::is_lvalue_reference<Return>::value &&
!std::is_pointer<Return>::value
Expand Down

0 comments on commit fc5d70d

Please sign in to comment.