diff --git a/include/pybind11/detail/smart_holder_type_casters.h b/include/pybind11/detail/smart_holder_type_casters.h index ec0aa774a..74624c5b7 100644 --- a/include/pybind11/detail/smart_holder_type_casters.h +++ b/include/pybind11/detail/smart_holder_type_casters.h @@ -549,7 +549,7 @@ struct smart_holder_type_caster> : smart_holder_type_ca static handle cast(const std::shared_ptr &src, return_value_policy policy, handle parent) { - return type_caster>::cast( + return smart_holder_type_caster>::cast( std::const_pointer_cast(src), // Const2Mutbl policy, parent); @@ -610,7 +610,7 @@ struct smart_holder_type_caster> : smart_holder_type_ca static constexpr auto name = _>(); static handle cast(std::unique_ptr &&src, return_value_policy policy, handle parent) { - return type_caster>::cast( + return smart_holder_type_caster>::cast( std::unique_ptr(const_cast(src.release())), // Const2Mutbl policy, parent);