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