diff --git a/include/boost/python/make_function.hpp b/include/boost/python/make_function.hpp index d824c0a4..fddc640b 100644 --- a/include/boost/python/make_function.hpp +++ b/include/boost/python/make_function.hpp @@ -12,27 +12,30 @@ # include # include # include +# include namespace boost { namespace python { template -PyObject* make_function(F f) +objects::function* make_function(F f) { - return new object::function( - object::py_function( - bind(detail::caller(), f, _1, _2))); + return new objects::function( + objects::py_function( + bind(detail::caller(), f, _1, _2)) + , detail::arg_tuple_size::value); } template -PyObject* make_constructor(T* = 0, ArgList* = 0, Generator* = 0) +objects::function* make_constructor(T* = 0, ArgList* = 0, Generator* = 0) { enum { nargs = mpl::size::value }; - return new object::function( - object::py_function( + return new objects::function( + objects::py_function( bind(detail::caller(), - object::make_holder + objects::make_holder ::template apply::execute - , _1, _2))); + , _1, _2)) + , nargs + 1); } }} // namespace boost::python