Chris@16
|
1
|
Chris@16
|
2 #if !defined(BOOST_PP_IS_ITERATING)
|
Chris@16
|
3
|
Chris@16
|
4 ///// header body
|
Chris@16
|
5
|
Chris@16
|
6 #ifndef BOOST_MPL_UNPACK_ARGS_HPP_INCLUDED
|
Chris@16
|
7 #define BOOST_MPL_UNPACK_ARGS_HPP_INCLUDED
|
Chris@16
|
8
|
Chris@16
|
9 // Copyright Aleksey Gurtovoy 2002-2004
|
Chris@16
|
10 //
|
Chris@16
|
11 // Distributed under the Boost Software License, Version 1.0.
|
Chris@16
|
12 // (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
13 // http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
14 //
|
Chris@16
|
15 // See http://www.boost.org/libs/mpl for documentation.
|
Chris@16
|
16
|
Chris@101
|
17 // $Id$
|
Chris@101
|
18 // $Date$
|
Chris@101
|
19 // $Revision$
|
Chris@16
|
20
|
Chris@16
|
21 #if !defined(BOOST_MPL_PREPROCESSING_MODE)
|
Chris@16
|
22 # include <boost/mpl/apply.hpp>
|
Chris@16
|
23 # include <boost/mpl/at.hpp>
|
Chris@16
|
24 # include <boost/mpl/size.hpp>
|
Chris@16
|
25 # include <boost/mpl/aux_/nttp_decl.hpp>
|
Chris@16
|
26 # include <boost/mpl/aux_/lambda_spec.hpp>
|
Chris@16
|
27 #endif
|
Chris@16
|
28
|
Chris@16
|
29 #include <boost/mpl/aux_/config/use_preprocessed.hpp>
|
Chris@16
|
30
|
Chris@16
|
31 #if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
|
Chris@16
|
32 && !defined(BOOST_MPL_PREPROCESSING_MODE)
|
Chris@16
|
33
|
Chris@16
|
34 # define BOOST_MPL_PREPROCESSED_HEADER unpack_args.hpp
|
Chris@16
|
35 # include <boost/mpl/aux_/include_preprocessed.hpp>
|
Chris@16
|
36
|
Chris@16
|
37 #else
|
Chris@16
|
38
|
Chris@16
|
39 # include <boost/mpl/limits/arity.hpp>
|
Chris@16
|
40 # include <boost/mpl/aux_/preprocessor/repeat.hpp>
|
Chris@16
|
41 # include <boost/mpl/aux_/config/ctps.hpp>
|
Chris@16
|
42 # include <boost/mpl/aux_/config/forwarding.hpp>
|
Chris@16
|
43 # include <boost/preprocessor/iterate.hpp>
|
Chris@16
|
44 # include <boost/preprocessor/cat.hpp>
|
Chris@16
|
45
|
Chris@16
|
46
|
Chris@16
|
47 namespace boost { namespace mpl {
|
Chris@16
|
48
|
Chris@16
|
49 // local macros, #undef-ined at the end of the header
|
Chris@16
|
50
|
Chris@16
|
51 # define AUX778076_UNPACK(unused, i, Args) \
|
Chris@16
|
52 , typename at_c<Args,i>::type \
|
Chris@16
|
53 /**/
|
Chris@16
|
54
|
Chris@16
|
55 # define AUX778076_UNPACKED_ARGS(n, Args) \
|
Chris@16
|
56 BOOST_MPL_PP_REPEAT(n, AUX778076_UNPACK, Args) \
|
Chris@16
|
57 /**/
|
Chris@16
|
58
|
Chris@16
|
59 namespace aux {
|
Chris@16
|
60
|
Chris@16
|
61 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
Chris@16
|
62 template< int size, typename F, typename Args >
|
Chris@16
|
63 struct unpack_args_impl;
|
Chris@16
|
64 #else
|
Chris@16
|
65 template< BOOST_MPL_AUX_NTTP_DECL(int, size) > struct unpack_args_impl
|
Chris@16
|
66 {
|
Chris@16
|
67 template< typename F, typename Args > struct apply;
|
Chris@16
|
68 };
|
Chris@16
|
69 #endif
|
Chris@16
|
70
|
Chris@16
|
71 #define BOOST_PP_ITERATION_PARAMS_1 \
|
Chris@16
|
72 (3,(0, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, <boost/mpl/unpack_args.hpp>))
|
Chris@16
|
73 #include BOOST_PP_ITERATE()
|
Chris@16
|
74
|
Chris@16
|
75 }
|
Chris@16
|
76
|
Chris@16
|
77 template<
|
Chris@16
|
78 typename F
|
Chris@16
|
79 >
|
Chris@16
|
80 struct unpack_args
|
Chris@16
|
81 {
|
Chris@16
|
82 template< typename Args > struct apply
|
Chris@16
|
83 #if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
|
Chris@16
|
84 # if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
Chris@16
|
85 : aux::unpack_args_impl< size<Args>::value,F,Args >
|
Chris@16
|
86 # else
|
Chris@16
|
87 : aux::unpack_args_impl< size<Args>::value >
|
Chris@16
|
88 ::template apply< F,Args >
|
Chris@16
|
89 # endif
|
Chris@16
|
90 {
|
Chris@16
|
91 #else // BOOST_MPL_CFG_NO_NESTED_FORWARDING
|
Chris@16
|
92 {
|
Chris@16
|
93 typedef typename aux::unpack_args_impl<
|
Chris@16
|
94 size<Args>::value
|
Chris@16
|
95 , F
|
Chris@16
|
96 , Args
|
Chris@16
|
97 >::type type;
|
Chris@16
|
98 #endif
|
Chris@16
|
99 };
|
Chris@16
|
100 };
|
Chris@16
|
101
|
Chris@16
|
102 BOOST_MPL_AUX_PASS_THROUGH_LAMBDA_SPEC(1, unpack_args)
|
Chris@16
|
103
|
Chris@16
|
104 # undef AUX778076_UNPACK
|
Chris@16
|
105 # undef AUX778076_UNPACKED_ARGS
|
Chris@16
|
106
|
Chris@16
|
107 }}
|
Chris@16
|
108
|
Chris@16
|
109 #endif // BOOST_MPL_CFG_USE_PREPROCESSED_HEADERS
|
Chris@16
|
110 #endif // BOOST_MPL_UNPACK_ARGS_HPP_INCLUDED
|
Chris@16
|
111
|
Chris@16
|
112 ///// iteration, depth == 1
|
Chris@16
|
113
|
Chris@16
|
114 // For gcc 4.4 compatability, we must include the
|
Chris@16
|
115 // BOOST_PP_ITERATION_DEPTH test inside an #else clause.
|
Chris@16
|
116 #else // BOOST_PP_IS_ITERATING
|
Chris@16
|
117 #if BOOST_PP_ITERATION_DEPTH() == 1
|
Chris@16
|
118
|
Chris@16
|
119 # define i_ BOOST_PP_FRAME_ITERATION(1)
|
Chris@16
|
120
|
Chris@16
|
121 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
Chris@16
|
122
|
Chris@16
|
123 template< typename F, typename Args >
|
Chris@16
|
124 struct unpack_args_impl<i_,F,Args>
|
Chris@16
|
125 : BOOST_PP_CAT(apply,i_)<
|
Chris@16
|
126 F
|
Chris@16
|
127 AUX778076_UNPACKED_ARGS(i_, Args)
|
Chris@16
|
128 >
|
Chris@16
|
129 {
|
Chris@16
|
130 };
|
Chris@16
|
131
|
Chris@16
|
132 #else
|
Chris@16
|
133
|
Chris@16
|
134 template<> struct unpack_args_impl<i_>
|
Chris@16
|
135 {
|
Chris@16
|
136 template< typename F, typename Args > struct apply
|
Chris@16
|
137 : BOOST_PP_CAT(apply,i_)<
|
Chris@16
|
138 F
|
Chris@16
|
139 AUX778076_UNPACKED_ARGS(i_, Args)
|
Chris@16
|
140 >
|
Chris@16
|
141 {
|
Chris@16
|
142 };
|
Chris@16
|
143 };
|
Chris@16
|
144
|
Chris@16
|
145 #endif
|
Chris@16
|
146
|
Chris@16
|
147 # undef i_
|
Chris@16
|
148
|
Chris@16
|
149 #endif // BOOST_PP_ITERATION_DEPTH()
|
Chris@16
|
150 #endif // BOOST_PP_IS_ITERATING
|