File indexing completed on 2025-01-18 09:39:06
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef BOOST_LAMBDA_ACTIONS_HPP
0014 #define BOOST_LAMBDA_ACTIONS_HPP
0015
0016 namespace boost {
0017 namespace lambda {
0018
0019
0020
0021 template<int Arity, class Act> class action;
0022
0023
0024
0025
0026 class assignment_action {};
0027 class subscript_action {};
0028
0029 template <class Action> class other_action;
0030
0031
0032 template <class RET> class explicit_return_type_action {};
0033
0034
0035 struct protect_action {};
0036
0037
0038 struct comma_action {};
0039
0040
0041
0042
0043
0044 template <class Action> struct is_protectable {
0045 BOOST_STATIC_CONSTANT(bool, value = false);
0046 };
0047
0048
0049
0050
0051 template<> struct is_protectable<other_action<comma_action> > {
0052 BOOST_STATIC_CONSTANT(bool, value = true);
0053 };
0054
0055
0056 namespace detail {
0057
0058
0059
0060
0061 class unspecified {};
0062 }
0063
0064
0065
0066
0067
0068
0069
0070 template <int I, class Result_type = detail::unspecified>
0071 class function_action {};
0072
0073 template<class T> class function_action<1, T> {
0074 public:
0075 template<class RET, class A1>
0076 static RET apply(A1& a1) {
0077 return function_adaptor<typename boost::remove_cv<A1>::type>::
0078 template apply<RET>(a1);
0079 }
0080 };
0081
0082 template<class T> class function_action<2, T> {
0083 public:
0084 template<class RET, class A1, class A2>
0085 static RET apply(A1& a1, A2& a2) {
0086 return function_adaptor<typename boost::remove_cv<A1>::type>::
0087 template apply<RET>(a1, a2);
0088 }
0089 };
0090
0091 template<class T> class function_action<3, T> {
0092 public:
0093 template<class RET, class A1, class A2, class A3>
0094 static RET apply(A1& a1, A2& a2, A3& a3) {
0095 return function_adaptor<typename boost::remove_cv<A1>::type>::
0096 template apply<RET>(a1, a2, a3);
0097 }
0098 };
0099
0100 template<class T> class function_action<4, T> {
0101 public:
0102 template<class RET, class A1, class A2, class A3, class A4>
0103 static RET apply(A1& a1, A2& a2, A3& a3, A4& a4) {
0104 return function_adaptor<typename boost::remove_cv<A1>::type>::
0105 template apply<RET>(a1, a2, a3, a4);
0106 }
0107 };
0108
0109 template<class T> class function_action<5, T> {
0110 public:
0111 template<class RET, class A1, class A2, class A3, class A4, class A5>
0112 static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5) {
0113 return function_adaptor<typename boost::remove_cv<A1>::type>::
0114 template apply<RET>(a1, a2, a3, a4, a5);
0115 }
0116 };
0117
0118 template<class T> class function_action<6, T> {
0119 public:
0120 template<class RET, class A1, class A2, class A3, class A4, class A5,
0121 class A6>
0122 static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6) {
0123 return function_adaptor<typename boost::remove_cv<A1>::type>::
0124 template apply<RET>(a1, a2, a3, a4, a5, a6);
0125 }
0126 };
0127
0128 template<class T> class function_action<7, T> {
0129 public:
0130 template<class RET, class A1, class A2, class A3, class A4, class A5,
0131 class A6, class A7>
0132 static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7) {
0133 return function_adaptor<typename boost::remove_cv<A1>::type>::
0134 template apply<RET>(a1, a2, a3, a4, a5, a6, a7);
0135 }
0136 };
0137
0138 template<class T> class function_action<8, T> {
0139 public:
0140 template<class RET, class A1, class A2, class A3, class A4, class A5,
0141 class A6, class A7, class A8>
0142 static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7,
0143 A8& a8) {
0144 return function_adaptor<typename boost::remove_cv<A1>::type>::
0145 template apply<RET>(a1, a2, a3, a4, a5, a6, a7, a8);
0146 }
0147 };
0148
0149 template<class T> class function_action<9, T> {
0150 public:
0151 template<class RET, class A1, class A2, class A3, class A4, class A5,
0152 class A6, class A7, class A8, class A9>
0153 static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7,
0154 A8& a8, A9& a9) {
0155 return function_adaptor<typename boost::remove_cv<A1>::type>::
0156 template apply<RET>(a1, a2, a3, a4, a5, a6, a7, a8, a9);
0157 }
0158 };
0159
0160 template<class T> class function_action<10, T> {
0161 public:
0162 template<class RET, class A1, class A2, class A3, class A4, class A5,
0163 class A6, class A7, class A8, class A9, class A10>
0164 static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7,
0165 A8& a8, A9& a9, A10& a10) {
0166 return function_adaptor<typename boost::remove_cv<A1>::type>::
0167 template apply<RET>(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
0168 }
0169 };
0170
0171 }
0172 }
0173
0174 #endif