Chris@16
|
1 // Copyright David Abrahams, Daniel Wallin 2003. Use, modification and
|
Chris@16
|
2 // distribution is subject to the Boost Software License, Version 1.0.
|
Chris@16
|
3 // (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
4 // http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
5
|
Chris@16
|
6 // This file generates overloads in this format:
|
Chris@16
|
7 //
|
Chris@16
|
8 // template<class A0, class A1>
|
Chris@16
|
9 // typename mpl::apply_wrap1<
|
Chris@16
|
10 // aux::make_arg_list<
|
Chris@16
|
11 // PS0,A0
|
Chris@16
|
12 // , aux::make_arg_list<
|
Chris@16
|
13 // PS1,A1
|
Chris@16
|
14 // , mpl::identity<aux::empty_arg_list>
|
Chris@16
|
15 // >
|
Chris@16
|
16 // >
|
Chris@16
|
17 // , unnamed_list
|
Chris@16
|
18 // >::type
|
Chris@16
|
19 // operator()(A0 const& a0, A1 const& a1) const
|
Chris@16
|
20 // {
|
Chris@16
|
21 // typedef typename mpl::apply_wrap1<
|
Chris@16
|
22 // aux::make_arg_list<
|
Chris@16
|
23 // PS0,A0
|
Chris@16
|
24 // , aux::make_arg_list<
|
Chris@16
|
25 // PS1,A1
|
Chris@16
|
26 // , mpl::identity<aux::empty_arg_list>
|
Chris@16
|
27 // >
|
Chris@16
|
28 // >
|
Chris@16
|
29 // >::type arg_tuple;
|
Chris@16
|
30 //
|
Chris@16
|
31 // return arg_tuple(
|
Chris@16
|
32 // a0
|
Chris@16
|
33 // , a1
|
Chris@16
|
34 // , aux::void_()
|
Chris@16
|
35 // ...
|
Chris@16
|
36 // );
|
Chris@16
|
37 // }
|
Chris@16
|
38 //
|
Chris@16
|
39
|
Chris@16
|
40 #if !defined(BOOST_PP_IS_ITERATING)
|
Chris@16
|
41 # error Boost.Parameters - do not include this file!
|
Chris@16
|
42 #endif
|
Chris@16
|
43
|
Chris@16
|
44 #define N BOOST_PP_ITERATION()
|
Chris@16
|
45
|
Chris@16
|
46 #define BOOST_PARAMETER_open_list(z, n, text) \
|
Chris@16
|
47 aux::item< \
|
Chris@16
|
48 BOOST_PP_CAT(PS, n), BOOST_PP_CAT(A, n)
|
Chris@16
|
49
|
Chris@16
|
50 #define BOOST_PARAMETER_close_list(z, n, text) >
|
Chris@16
|
51
|
Chris@16
|
52 #define BOOST_PARAMETER_arg_list(n) \
|
Chris@16
|
53 aux::make_arg_list< \
|
Chris@16
|
54 BOOST_PP_ENUM(N, BOOST_PARAMETER_open_list, _) \
|
Chris@16
|
55 , void_ \
|
Chris@16
|
56 BOOST_PP_REPEAT(N, BOOST_PARAMETER_close_list, _) \
|
Chris@16
|
57 , deduced_list \
|
Chris@16
|
58 , aux::tag_keyword_arg \
|
Chris@16
|
59 >
|
Chris@16
|
60
|
Chris@16
|
61 #define BOOST_PARAMETER_arg_pack_init(z, n, limit) \
|
Chris@16
|
62 BOOST_PP_CAT(a, BOOST_PP_SUB(limit,n))
|
Chris@16
|
63
|
Chris@16
|
64 template<BOOST_PP_ENUM_PARAMS(N, class A)>
|
Chris@16
|
65 typename mpl::first<
|
Chris@16
|
66 typename BOOST_PARAMETER_arg_list(N)::type
|
Chris@16
|
67 >::type
|
Chris@16
|
68 operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, & a)) const
|
Chris@16
|
69 {
|
Chris@16
|
70 typedef typename BOOST_PARAMETER_arg_list(N)::type result;
|
Chris@16
|
71
|
Chris@16
|
72 typedef typename mpl::first<result>::type result_type;
|
Chris@16
|
73 typedef typename mpl::second<result>::type error;
|
Chris@16
|
74 error();
|
Chris@16
|
75
|
Chris@16
|
76 return result_type(
|
Chris@16
|
77 BOOST_PP_ENUM(N, BOOST_PARAMETER_arg_pack_init, BOOST_PP_DEC(N))
|
Chris@16
|
78 BOOST_PP_ENUM_TRAILING_PARAMS(
|
Chris@16
|
79 BOOST_PP_SUB(BOOST_PARAMETER_MAX_ARITY, N)
|
Chris@16
|
80 , aux::void_reference() BOOST_PP_INTERCEPT
|
Chris@16
|
81 ));
|
Chris@16
|
82 }
|
Chris@16
|
83
|
Chris@16
|
84 #undef BOOST_PARAMETER_arg_list
|
Chris@16
|
85 #undef BOOST_PARAMETER_open_list
|
Chris@16
|
86 #undef BOOST_PARAMETER_close_list
|
Chris@16
|
87 #undef N
|
Chris@16
|
88
|