]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/parameter/aux_/preprocessor/overloads.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / parameter / aux_ / preprocessor / overloads.hpp
1 // Copyright David Abrahams, Daniel Wallin 2003.
2 // Distributed under 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 <typename A0, typename A1>
9 // typename ::boost::mpl::apply_wrap1<
10 // ::boost::parameter::aux::make_arg_list<
11 // PS0,A0
12 // , ::boost::parameter::aux::make_arg_list<
13 // PS1,A1
14 // , ::boost::mpl::identity<
15 // ::boost::parameter::aux::empty_arg_list
16 // >
17 // >
18 // >
19 // , unnamed_list
20 // >::type
21 // operator()(A0 const& a0, A1 const& a1) const
22 // {
23 // typedef typename ::boost::mpl::apply_wrap1<
24 // ::boost::parameter::aux::make_arg_list<
25 // PS0,A0
26 // , ::boost::parameter::aux::make_arg_list<
27 // PS1,A1
28 // , ::boost::mpl::identity<
29 // ::boost::parameter::aux::empty_arg_list
30 // >
31 // >
32 // >
33 // >::type arg_tuple;
34 //
35 // return arg_tuple(
36 // a0
37 // , a1
38 // , ::boost::parameter::aux::void_()
39 // ...
40 // );
41 // }
42 //
43
44 #if !defined(BOOST_PP_IS_ITERATING)
45 # error Boost.Parameters - do not include this file!
46 #endif
47
48 #define N BOOST_PP_ITERATION()
49
50 #define BOOST_PARAMETER_open_list(z, n, text) \
51 ::boost::parameter::aux::item< \
52 BOOST_PP_CAT(PS, n), BOOST_PP_CAT(A, n)
53
54 #define BOOST_PARAMETER_close_list(z, n, text) >
55
56 #define BOOST_PARAMETER_arg_list(n) \
57 ::boost::parameter::aux::make_arg_list< \
58 BOOST_PP_ENUM(N, BOOST_PARAMETER_open_list, _) \
59 , ::boost::parameter::void_ \
60 BOOST_PP_REPEAT(N, BOOST_PARAMETER_close_list, _) \
61 , deduced_list \
62 , ::boost::parameter::aux::tag_keyword_arg \
63 >
64
65 #define BOOST_PARAMETER_arg_pack_init(z, n, limit) \
66 BOOST_PP_CAT(a, BOOST_PP_SUB(limit, n))
67
68 template <BOOST_PP_ENUM_PARAMS(N, typename A)>
69 typename ::boost::mpl::first<
70 typename BOOST_PARAMETER_arg_list(N)::type
71 >::type
72 operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, & a)) const
73 {
74 typedef typename BOOST_PARAMETER_arg_list(N)::type result;
75 typedef typename ::boost::mpl::first<result>::type result_type;
76 typedef typename ::boost::mpl::second<result>::type error;
77 error();
78
79 return result_type(
80 BOOST_PP_ENUM(N, BOOST_PARAMETER_arg_pack_init, BOOST_PP_DEC(N))
81 BOOST_PP_ENUM_TRAILING_PARAMS(
82 BOOST_PP_SUB(BOOST_PARAMETER_COMPOSE_MAX_ARITY, N)
83 , ::boost::parameter::aux::void_reference() BOOST_PP_INTERCEPT
84 )
85 );
86 }
87
88 #undef BOOST_PARAMETER_arg_list
89 #undef BOOST_PARAMETER_close_list
90 #undef BOOST_PARAMETER_open_list
91 #undef N
92