File indexing completed on 2025-01-18 09:34:40
0001
0002
0003
0004
0005
0006
0007
0008
0009 #if !defined(BOOST_FUSION_FUNCTIONAL_ADAPTER_UNFUSED_HPP_INCLUDED)
0010 #if !defined(BOOST_PP_IS_ITERATING)
0011
0012 #include <boost/preprocessor/cat.hpp>
0013 #include <boost/preprocessor/iteration/iterate.hpp>
0014 #include <boost/preprocessor/repetition/enum_params.hpp>
0015 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
0016 #include <boost/preprocessor/facilities/intercept.hpp>
0017
0018 #include <boost/utility/result_of.hpp>
0019
0020 #include <boost/config.hpp>
0021
0022 #include <boost/fusion/container/vector/vector.hpp>
0023
0024 #include <boost/fusion/functional/adapter/limits.hpp>
0025 #include <boost/fusion/functional/adapter/detail/access.hpp>
0026
0027 #if defined (BOOST_MSVC)
0028 # pragma warning(push)
0029 # pragma warning (disable: 4512)
0030 #endif
0031
0032 namespace boost { namespace fusion
0033 {
0034 template <class Function, bool AllowNullary = true>
0035 class unfused;
0036
0037
0038
0039 template <class Function>
0040 class unfused<Function,true>
0041 : public unfused<Function,false>
0042 {
0043 typedef typename detail::qf_c<Function>::type function_c;
0044 typedef typename detail::qf<Function>::type function;
0045 typedef typename detail::call_param<Function>::type func_const_fwd_t;
0046 public:
0047
0048 using unfused<Function,false>::operator();
0049
0050 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0051 inline explicit unfused(func_const_fwd_t f = function())
0052 : unfused<Function,false>(f)
0053 { }
0054
0055 typedef typename boost::result_of<
0056 function_c(fusion::vector0<> &) >::type call_const_0_result;
0057
0058 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0059 inline call_const_0_result operator()() const
0060 {
0061 fusion::vector0<> arg;
0062 return this->fnc_transformed(arg);
0063 }
0064
0065 typedef typename boost::result_of<
0066 function(fusion::vector0<> &) >::type call_0_result;
0067
0068 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0069 inline call_0_result operator()()
0070 {
0071 fusion::vector0<> arg;
0072 return this->fnc_transformed(arg);
0073 }
0074 };
0075
0076 template <class Function> class unfused<Function,false>
0077 {
0078 protected:
0079 Function fnc_transformed;
0080 typedef typename detail::qf_c<Function>::type function_c;
0081 typedef typename detail::qf<Function>::type function;
0082 typedef typename detail::call_param<Function>::type func_const_fwd_t;
0083 public:
0084
0085 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0086 inline explicit unfused(func_const_fwd_t f = function())
0087 : fnc_transformed(f)
0088 { }
0089
0090 template <typename Sig>
0091 struct result;
0092
0093 #define BOOST_PP_FILENAME_1 \
0094 <boost/fusion/functional/adapter/unfused.hpp>
0095 #define BOOST_PP_ITERATION_LIMITS \
0096 (1,BOOST_FUSION_UNFUSED_MAX_ARITY)
0097 #include BOOST_PP_ITERATE()
0098 };
0099 }}
0100
0101 #if defined (BOOST_MSVC)
0102 # pragma warning(pop)
0103 #endif
0104
0105 namespace boost
0106 {
0107 #if !defined(BOOST_RESULT_OF_USE_DECLTYPE) || defined(BOOST_NO_CXX11_DECLTYPE)
0108 template<class F>
0109 struct result_of< boost::fusion::unfused<F> const () >
0110 {
0111 typedef typename boost::fusion::unfused<F>::call_const_0_result type;
0112 };
0113 template<class F>
0114 struct result_of< boost::fusion::unfused<F>() >
0115 {
0116 typedef typename boost::fusion::unfused<F>::call_0_result type;
0117 };
0118 #endif
0119 template<class F>
0120 struct tr1_result_of< boost::fusion::unfused<F> const () >
0121 {
0122 typedef typename boost::fusion::unfused<F>::call_const_0_result type;
0123 };
0124 template<class F>
0125 struct tr1_result_of< boost::fusion::unfused<F>() >
0126 {
0127 typedef typename boost::fusion::unfused<F>::call_0_result type;
0128 };
0129 }
0130
0131 #define BOOST_FUSION_FUNCTIONAL_ADAPTER_UNFUSED_HPP_INCLUDED
0132 #else
0133
0134
0135
0136
0137
0138 #define N BOOST_PP_ITERATION()
0139
0140 template <class Self, BOOST_PP_ENUM_PARAMS(N,typename T)>
0141 struct result< Self const (BOOST_PP_ENUM_PARAMS(N,T)) >
0142 : boost::result_of< function_c(
0143 BOOST_PP_CAT(fusion::vector,N)< BOOST_PP_ENUM_BINARY_PARAMS(N,
0144 typename detail::mref<T,>::type BOOST_PP_INTERCEPT) > & )>
0145 { };
0146
0147 template <class Self, BOOST_PP_ENUM_PARAMS(N,typename T)>
0148 struct result< Self(BOOST_PP_ENUM_PARAMS(N,T)) >
0149 : boost::result_of< function(
0150 BOOST_PP_CAT(fusion::vector,N)< BOOST_PP_ENUM_BINARY_PARAMS(N,
0151 typename detail::mref<T,>::type BOOST_PP_INTERCEPT) > & )>
0152 { };
0153
0154 template <BOOST_PP_ENUM_PARAMS(N,typename T)>
0155 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0156 inline typename boost::result_of<function_c(BOOST_PP_CAT(fusion::vector,N)
0157 <BOOST_PP_ENUM_BINARY_PARAMS(N,T,& BOOST_PP_INTERCEPT)> & )>::type
0158 operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,T,& a)) const
0159 {
0160 BOOST_PP_CAT(fusion::vector,N)<
0161 BOOST_PP_ENUM_BINARY_PARAMS(N,T,& BOOST_PP_INTERCEPT) >
0162 arg(BOOST_PP_ENUM_PARAMS(N,a));
0163 return this->fnc_transformed(arg);
0164 }
0165
0166 template <BOOST_PP_ENUM_PARAMS(N,typename T)>
0167 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0168 inline typename boost::result_of<function(BOOST_PP_CAT(fusion::vector,N)
0169 <BOOST_PP_ENUM_BINARY_PARAMS(N,T,& BOOST_PP_INTERCEPT)> & )>::type
0170 operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,T,& a))
0171 {
0172 BOOST_PP_CAT(fusion::vector,N)<
0173 BOOST_PP_ENUM_BINARY_PARAMS(N,T,& BOOST_PP_INTERCEPT) >
0174 arg(BOOST_PP_ENUM_PARAMS(N,a));
0175 return this->fnc_transformed(arg);
0176 }
0177 #undef N
0178 #endif
0179 #endif
0180