File indexing completed on 2025-01-18 09:50:38
0001
0002
0003
0004
0005 #ifndef NULLARY_FUNCTION_ADAPTOR_DWA2003824_HPP
0006 # define NULLARY_FUNCTION_ADAPTOR_DWA2003824_HPP
0007
0008 # include <boost/python/detail/prefix.hpp>
0009 # include <boost/preprocessor/iteration/local.hpp>
0010 # include <boost/preprocessor/facilities/intercept.hpp>
0011 # include <boost/preprocessor/repetition/enum_params.hpp>
0012 # include <boost/preprocessor/repetition/enum_binary_params.hpp>
0013
0014 namespace boost { namespace python { namespace detail {
0015
0016
0017
0018
0019 template <class NullaryFunction>
0020 struct nullary_function_adaptor
0021 {
0022 nullary_function_adaptor(NullaryFunction fn)
0023 : m_fn(fn)
0024 {}
0025
0026 void operator()() const { m_fn(); }
0027
0028 # define BOOST_PP_LOCAL_MACRO(i) \
0029 template <BOOST_PP_ENUM_PARAMS_Z(1, i, class A)> \
0030 void operator()( \
0031 BOOST_PP_ENUM_BINARY_PARAMS_Z(1, i, A, const& BOOST_PP_INTERCEPT) \
0032 ) const \
0033 { \
0034 m_fn(); \
0035 }
0036
0037 # define BOOST_PP_LOCAL_LIMITS (1, BOOST_PYTHON_MAX_ARITY)
0038 # include BOOST_PP_LOCAL_ITERATE()
0039
0040 private:
0041 NullaryFunction m_fn;
0042 };
0043
0044 }}}
0045
0046 #endif