1 /*=============================================================================
2 Copyright (c) 2001-2007 Joel de Guzman
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
15 struct member_function_ptr_impl<1>
17 template <typename RT, typename FP>
20 typedef RT result_type;
23 template <typename Class, typename A0>
24 RT operator()(Class& obj, A0 & a0) const
26 BOOST_PROTO_USE_GET_POINTER();
27 typedef typename proto::detail::classtypeof<FP>::type class_type;
28 return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0);
30 template <typename Class, typename A0>
31 RT operator()(Class* obj, A0 & a0) const
33 return (obj->*fp)(a0);
46 struct member_function_ptr_impl<2>
48 template <typename RT, typename FP>
51 typedef RT result_type;
54 template <typename Class, typename A0 , typename A1>
55 RT operator()(Class& obj, A0 & a0 , A1 & a1) const
57 BOOST_PROTO_USE_GET_POINTER();
58 typedef typename proto::detail::classtypeof<FP>::type class_type;
59 return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0 , a1);
61 template <typename Class, typename A0 , typename A1>
62 RT operator()(Class* obj, A0 & a0 , A1 & a1) const
64 return (obj->*fp)(a0 , a1);
77 struct member_function_ptr_impl<3>
79 template <typename RT, typename FP>
82 typedef RT result_type;
85 template <typename Class, typename A0 , typename A1 , typename A2>
86 RT operator()(Class& obj, A0 & a0 , A1 & a1 , A2 & a2) const
88 BOOST_PROTO_USE_GET_POINTER();
89 typedef typename proto::detail::classtypeof<FP>::type class_type;
90 return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0 , a1 , a2);
92 template <typename Class, typename A0 , typename A1 , typename A2>
93 RT operator()(Class* obj, A0 & a0 , A1 & a1 , A2 & a2) const
95 return (obj->*fp)(a0 , a1 , a2);
108 struct member_function_ptr_impl<4>
110 template <typename RT, typename FP>
113 typedef RT result_type;
116 template <typename Class, typename A0 , typename A1 , typename A2 , typename A3>
117 RT operator()(Class& obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3) const
119 BOOST_PROTO_USE_GET_POINTER();
120 typedef typename proto::detail::classtypeof<FP>::type class_type;
121 return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0 , a1 , a2 , a3);
123 template <typename Class, typename A0 , typename A1 , typename A2 , typename A3>
124 RT operator()(Class* obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3) const
126 return (obj->*fp)(a0 , a1 , a2 , a3);
139 struct member_function_ptr_impl<5>
141 template <typename RT, typename FP>
144 typedef RT result_type;
147 template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
148 RT operator()(Class& obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4) const
150 BOOST_PROTO_USE_GET_POINTER();
151 typedef typename proto::detail::classtypeof<FP>::type class_type;
152 return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0 , a1 , a2 , a3 , a4);
154 template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
155 RT operator()(Class* obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4) const
157 return (obj->*fp)(a0 , a1 , a2 , a3 , a4);
170 struct member_function_ptr_impl<6>
172 template <typename RT, typename FP>
175 typedef RT result_type;
178 template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
179 RT operator()(Class& obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5) const
181 BOOST_PROTO_USE_GET_POINTER();
182 typedef typename proto::detail::classtypeof<FP>::type class_type;
183 return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0 , a1 , a2 , a3 , a4 , a5);
185 template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
186 RT operator()(Class* obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5) const
188 return (obj->*fp)(a0 , a1 , a2 , a3 , a4 , a5);
201 struct member_function_ptr_impl<7>
203 template <typename RT, typename FP>
206 typedef RT result_type;
209 template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
210 RT operator()(Class& obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5 , A6 & a6) const
212 BOOST_PROTO_USE_GET_POINTER();
213 typedef typename proto::detail::classtypeof<FP>::type class_type;
214 return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0 , a1 , a2 , a3 , a4 , a5 , a6);
216 template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
217 RT operator()(Class* obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5 , A6 & a6) const
219 return (obj->*fp)(a0 , a1 , a2 , a3 , a4 , a5 , a6);
232 struct member_function_ptr_impl<8>
234 template <typename RT, typename FP>
237 typedef RT result_type;
240 template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
241 RT operator()(Class& obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5 , A6 & a6 , A7 & a7) const
243 BOOST_PROTO_USE_GET_POINTER();
244 typedef typename proto::detail::classtypeof<FP>::type class_type;
245 return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
247 template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
248 RT operator()(Class* obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5 , A6 & a6 , A7 & a7) const
250 return (obj->*fp)(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
263 struct member_function_ptr_impl<9>
265 template <typename RT, typename FP>
268 typedef RT result_type;
271 template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
272 RT operator()(Class& obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5 , A6 & a6 , A7 & a7 , A8 & a8) const
274 BOOST_PROTO_USE_GET_POINTER();
275 typedef typename proto::detail::classtypeof<FP>::type class_type;
276 return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
278 template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
279 RT operator()(Class* obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5 , A6 & a6 , A7 & a7 , A8 & a8) const
281 return (obj->*fp)(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
294 struct member_function_ptr_impl<10>
296 template <typename RT, typename FP>
299 typedef RT result_type;
302 template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
303 RT operator()(Class& obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5 , A6 & a6 , A7 & a7 , A8 & a8 , A9 & a9) const
305 BOOST_PROTO_USE_GET_POINTER();
306 typedef typename proto::detail::classtypeof<FP>::type class_type;
307 return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9);
309 template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
310 RT operator()(Class* obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5 , A6 & a6 , A7 & a7 , A8 & a8 , A9 & a9) const
312 return (obj->*fp)(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9);