diff --git a/include/pybind11/detail/smart_holder_poc.h b/include/pybind11/detail/smart_holder_poc.h index ed6f322b45..65b0581617 100644 --- a/include/pybind11/detail/smart_holder_poc.h +++ b/include/pybind11/detail/smart_holder_poc.h @@ -111,14 +111,14 @@ guarded_delete make_guarded_builtin_delete(bool armed_flag) { template struct custom_deleter { D deleter; - custom_deleter(D &&deleter) : deleter{std::move(deleter)} {} + explicit custom_deleter(D &&deleter) : deleter{std::move(deleter)} {} void operator()(void *raw_ptr) { deleter(static_cast(raw_ptr)); } }; template guarded_delete make_guarded_custom_deleter(D &&uqp_del, bool armed_flag) { - return guarded_delete(std::function(custom_deleter(std::move(uqp_del))), - armed_flag); + return guarded_delete( + std::function(custom_deleter(std::forward(uqp_del))), armed_flag); } template