diff --git a/include/pybind11/functional.h b/include/pybind11/functional.h index f2a752e9d..4034990d8 100644 --- a/include/pybind11/functional.h +++ b/include/pybind11/functional.h @@ -99,7 +99,7 @@ public: Return operator()(Args... args) const { gil_scoped_acquire acq; // casts the returned object as a rvalue to the return type - return object(hfunc.f(std::forward(args)...)).template cast(); + return hfunc.f(std::forward(args)...).template cast(); } };