source: NonGTP/Boost/boost/parameter/aux_/overloads.hpp @ 857

Revision 857, 2.0 KB checked in by igarcia, 19 years ago (diff)
Line 
1// Copyright David Abrahams, Daniel Wallin 2003. Use, modification and
2// distribution is subject to the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at
4// http://www.boost.org/LICENSE_1_0.txt)
5
6// This file generates overloads in this format:
7//
8//     template<class A0, class A1>
9//     typename aux::make_arg_list<
10//         PS0,A0
11//       , aux::make_arg_list<
12//             PS1,A1
13//           , mpl::identity<aux::empty_arg_list>
14//         >
15//     >::type
16//     operator()(A0 const& a0, A1 const& a1) const
17//     {
18//         typedef typename aux::make_arg_list<
19//             PS0,A0
20//           , aux::make_arg_list<
21//                 PS1,A1
22//               , mpl::identity<aux::empty_arg_list>
23//             >
24//         >::type arg_tuple;
25//
26//         return arg_tuple(
27//             a0
28//           , a1
29//           , aux::void_()
30//             ...
31//         );
32//     }
33//
34
35#if !defined(BOOST_PP_IS_ITERATING)
36# error Boost.Parameters - do not include this file!
37#endif
38
39#define N BOOST_PP_ITERATION()
40
41#define BOOST_PARAMETER_open_list(z, n, text) \
42    aux::make_arg_list< \
43        BOOST_PP_CAT(PS, n), BOOST_PP_CAT(A, n) \
44
45#define BOOST_PARAMETER_close_list(z, n, text) >
46
47#define BOOST_PARAMETER_arg_list(n) \
48    BOOST_PP_ENUM(N, BOOST_PARAMETER_open_list, _) \
49  , mpl::identity<aux::empty_arg_list> \
50    BOOST_PP_REPEAT(N, BOOST_PARAMETER_close_list, _)
51
52template<BOOST_PP_ENUM_PARAMS(N, class A)>
53typename BOOST_PARAMETER_arg_list(N)::type
54operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& a)) const
55{
56    typedef typename BOOST_PARAMETER_arg_list(N)::type arg_tuple;
57
58    return arg_tuple(
59        BOOST_PP_ENUM_PARAMS(N, a)
60        BOOST_PP_ENUM_TRAILING_PARAMS(
61            BOOST_PP_SUB(BOOST_PARAMETER_MAX_ARITY, N)
62          , aux::void_() BOOST_PP_INTERCEPT
63        ));
64}
65
66#undef BOOST_PARAMETER_arg_list
67#undef BOOST_PARAMETER_open_list
68#undef BOOST_PARAMETER_close_list
69#undef N
70
Note: See TracBrowser for help on using the repository browser.