File indexing completed on 2025-12-16 10:07:42
0001
0002
0003
0004
0005 #ifndef FUNCTION_HANDLE_DWA2002725_HPP
0006 # define FUNCTION_HANDLE_DWA2002725_HPP
0007 # include <boost/python/handle.hpp>
0008 # include <boost/python/detail/caller.hpp>
0009 # include <boost/python/default_call_policies.hpp>
0010 # include <boost/python/object/py_function.hpp>
0011 # include <boost/python/signature.hpp>
0012
0013 namespace boost { namespace python { namespace objects {
0014
0015 BOOST_PYTHON_DECL handle<> function_handle_impl(py_function const& f);
0016
0017
0018
0019
0020 template <class F, class Signature>
0021 inline handle<> function_handle(F const& f, Signature)
0022 {
0023 enum { n_arguments = mpl::size<Signature>::value - 1 };
0024
0025 return objects::function_handle_impl(
0026 python::detail::caller<
0027 F,default_call_policies,Signature
0028 >(
0029 f, default_call_policies()
0030 )
0031 );
0032 }
0033
0034
0035
0036 template <class F>
0037 handle<> make_function_handle(F f)
0038 {
0039 return objects::function_handle(f, python::detail::get_signature(f));
0040 }
0041
0042 }}}
0043
0044 #endif