1 // Copyright David Abrahams 2003.
2 // Distributed under the Boost Software License, Version 1.0. (See
3 // accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
5 #ifndef RAW_FUNCTION_DWA200336_HPP
6 # define RAW_FUNCTION_DWA200336_HPP
8 # include <boost/python/detail/prefix.hpp>
10 # include <boost/python/tuple.hpp>
11 # include <boost/python/dict.hpp>
12 # include <boost/python/object/py_function.hpp>
13 # include <boost/mpl/vector/vector10.hpp>
15 # include <boost/limits.hpp>
18 namespace boost { namespace python {
25 raw_dispatcher(F f) : f(f) {}
27 PyObject* operator()(PyObject* args, PyObject* keywords)
32 tuple(borrowed_reference(args))
33 , keywords ? dict(borrowed_reference(keywords)) : dict()
43 object BOOST_PYTHON_DECL make_raw_function(objects::py_function);
47 object raw_function(F f, std::size_t min_args = 0)
49 return detail::make_raw_function(
51 detail::raw_dispatcher<F>(f)
52 , mpl::vector1<PyObject*>()
54 , (std::numeric_limits<unsigned>::max)()
59 }} // namespace boost::python
61 #endif // RAW_FUNCTION_DWA200336_HPP