diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h index 64d590dbf8..7623e37dfa 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -789,6 +789,10 @@ struct move_only_holder_caster : type_caster_base { auto *ptr = holder_helper::get(src); return type_caster_base::cast_holder(ptr, holder_erased(std::addressof(src))); } + static handle cast(const holder_type& src, return_value_policy, handle) { + const auto *ptr = holder_helper::get(src); + return type_caster_base::cast_holder(ptr, holder_erased(std::addressof(src))); + } // Disable these? // explicit operator type*() { return this->value; }