]> AND Private Git Repository - canny.git/blob - stc/exp/ml_stc_linux_make_v1.0/include/boost/mpl/aux_/lambda_no_ctps.hpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
bdf5452efec62ad44a3bb411d6780dbd15688598
[canny.git] / stc / exp / ml_stc_linux_make_v1.0 / include / boost / mpl / aux_ / lambda_no_ctps.hpp
1 \r
2 #if !defined(BOOST_PP_IS_ITERATING)\r
3 \r
4 ///// header body\r
5 \r
6 #ifndef BOOST_MPL_AUX_LAMBDA_NO_CTPS_HPP_INCLUDED\r
7 #define BOOST_MPL_AUX_LAMBDA_NO_CTPS_HPP_INCLUDED\r
8 \r
9 // Copyright Aleksey Gurtovoy 2000-2004\r
10 //\r
11 // Distributed under the Boost Software License, Version 1.0. \r
12 // (See accompanying file LICENSE_1_0.txt or copy at \r
13 // http://www.boost.org/LICENSE_1_0.txt)\r
14 //\r
15 // See http://www.boost.org/libs/mpl for documentation.\r
16 \r
17 // $Id: lambda_no_ctps.hpp 49267 2008-10-11 06:19:02Z agurtovoy $\r
18 // $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $\r
19 // $Revision: 49267 $\r
20 \r
21 #if !defined(BOOST_MPL_PREPROCESSING_MODE)\r
22 #   include <boost/mpl/lambda_fwd.hpp>\r
23 #   include <boost/mpl/bind_fwd.hpp>\r
24 #   include <boost/mpl/protect.hpp>\r
25 #   include <boost/mpl/is_placeholder.hpp>\r
26 #   include <boost/mpl/if.hpp>\r
27 #   include <boost/mpl/identity.hpp>\r
28 #   include <boost/mpl/bool.hpp>\r
29 #   include <boost/mpl/aux_/na_spec.hpp>\r
30 #   include <boost/mpl/aux_/lambda_support.hpp>\r
31 #   include <boost/mpl/aux_/template_arity.hpp>\r
32 #   include <boost/mpl/aux_/value_wknd.hpp>\r
33 #endif\r
34 \r
35 #include <boost/mpl/aux_/config/use_preprocessed.hpp>\r
36 \r
37 #if    !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \\r
38     && !defined(BOOST_MPL_PREPROCESSING_MODE)\r
39 \r
40 #   define BOOST_MPL_PREPROCESSED_HEADER lambda_no_ctps.hpp\r
41 #   include <boost/mpl/aux_/include_preprocessed.hpp>\r
42 \r
43 #else\r
44 \r
45 #   include <boost/mpl/limits/arity.hpp>\r
46 #   include <boost/mpl/aux_/preprocessor/params.hpp>\r
47 #   include <boost/mpl/aux_/preprocessor/default_params.hpp>\r
48 #   include <boost/mpl/aux_/preprocessor/repeat.hpp>\r
49 #   include <boost/mpl/aux_/preprocessor/enum.hpp>\r
50 #   include <boost/mpl/aux_/config/msvc.hpp>\r
51 #   include <boost/mpl/aux_/config/workaround.hpp>\r
52 \r
53 #   include <boost/preprocessor/comma_if.hpp>\r
54 #   include <boost/preprocessor/iterate.hpp>\r
55 #   include <boost/preprocessor/inc.hpp>\r
56 #   include <boost/preprocessor/cat.hpp>\r
57 \r
58 namespace boost { namespace mpl {\r
59 \r
60 #   define AUX778076_LAMBDA_PARAMS(i_, param) \\r
61     BOOST_MPL_PP_PARAMS(i_, param) \\r
62     /**/\r
63 \r
64 namespace aux {\r
65 \r
66 #define n_ BOOST_MPL_LIMIT_METAFUNCTION_ARITY\r
67 template<\r
68       BOOST_MPL_PP_DEFAULT_PARAMS(n_,bool C,false)\r
69     >\r
70 struct lambda_or\r
71     : true_\r
72 {\r
73 };\r
74 \r
75 template<>\r
76 struct lambda_or< BOOST_MPL_PP_ENUM(n_,false) >\r
77     : false_\r
78 {\r
79 };\r
80 #undef n_\r
81 \r
82 template< typename Arity > struct lambda_impl\r
83 {\r
84     template< typename T, typename Tag, typename Protect > struct result_\r
85     {\r
86         typedef T type;\r
87         typedef is_placeholder<T> is_le;\r
88     };\r
89 };\r
90 \r
91 #define BOOST_PP_ITERATION_PARAMS_1 \\r
92     (3,(1, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, <boost/mpl/aux_/lambda_no_ctps.hpp>))\r
93 #include BOOST_PP_ITERATE()\r
94 \r
95 } // namespace aux\r
96 \r
97 template<\r
98       typename T\r
99     , typename Tag\r
100     , typename Protect\r
101     >\r
102 struct lambda\r
103 {\r
104     /// Metafunction forwarding confuses MSVC 6.x\r
105     typedef typename aux::template_arity<T>::type arity_;\r
106     typedef typename aux::lambda_impl<arity_>\r
107         ::template result_< T,Tag,Protect > l_;\r
108 \r
109     typedef typename l_::type type;\r
110     typedef typename l_::is_le is_le;\r
111     \r
112     BOOST_MPL_AUX_LAMBDA_SUPPORT(3, lambda, (T, Tag, Protect))\r
113 };\r
114 \r
115 BOOST_MPL_AUX_NA_SPEC2(1, 3, lambda)\r
116 \r
117 template<\r
118       typename T\r
119     >\r
120 struct is_lambda_expression\r
121     : lambda<T>::is_le\r
122 {\r
123 };\r
124 \r
125 #   undef AUX778076_LAMBDA_PARAMS\r
126 \r
127 }}\r
128 \r
129 #endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS\r
130 #endif // BOOST_MPL_AUX_LAMBDA_NO_CTPS_HPP_INCLUDED\r
131 \r
132 ///// iteration, depth == 1\r
133 \r
134 #else\r
135 \r
136 #define i_ BOOST_PP_FRAME_ITERATION(1)\r
137 \r
138 #   define AUX778076_LAMBDA_TYPEDEF(unused, i_, F) \\r
139     typedef lambda< \\r
140           typename F::BOOST_PP_CAT(arg,BOOST_PP_INC(i_)) \\r
141         , Tag \\r
142         , false_ \\r
143         > BOOST_PP_CAT(l,BOOST_PP_INC(i_)); \\r
144     /**/\r
145 \r
146 #   define AUX778076_IS_LE_TYPEDEF(unused, i_, unused2) \\r
147     typedef typename BOOST_PP_CAT(l,BOOST_PP_INC(i_))::is_le \\r
148         BOOST_PP_CAT(is_le,BOOST_PP_INC(i_)); \\r
149     /**/\r
150 \r
151 #   define AUX778076_IS_LAMBDA_EXPR(unused, i_, unused2) \\r
152     BOOST_PP_COMMA_IF(i_) \\r
153     BOOST_MPL_AUX_MSVC_VALUE_WKND(BOOST_PP_CAT(is_le,BOOST_PP_INC(i_)))::value \\r
154     /**/\r
155 \r
156 #   define AUX778076_LAMBDA_RESULT(unused, i_, unused2) \\r
157     , typename BOOST_PP_CAT(l,BOOST_PP_INC(i_))::type \\r
158     /**/\r
159 \r
160 template<> struct lambda_impl< int_<i_> >\r
161 {\r
162     template< typename F, typename Tag, typename Protect > struct result_\r
163     {\r
164         BOOST_MPL_PP_REPEAT(i_, AUX778076_LAMBDA_TYPEDEF, F)\r
165         BOOST_MPL_PP_REPEAT(i_, AUX778076_IS_LE_TYPEDEF, unused)\r
166 \r
167         typedef aux::lambda_or<\r
168               BOOST_MPL_PP_REPEAT(i_, AUX778076_IS_LAMBDA_EXPR, unused)\r
169             > is_le;\r
170 \r
171         typedef BOOST_PP_CAT(bind,i_)<\r
172               typename F::rebind\r
173             BOOST_MPL_PP_REPEAT(i_, AUX778076_LAMBDA_RESULT, unused)\r
174             > bind_;\r
175 \r
176         typedef typename if_<\r
177               is_le\r
178             , if_< Protect, mpl::protect<bind_>, bind_ >\r
179             , identity<F>\r
180             >::type type_;\r
181     \r
182         typedef typename type_::type type;\r
183     };\r
184 };\r
185 \r
186 #   undef AUX778076_LAMBDA_RESULT\r
187 #   undef AUX778076_IS_LAMBDA_EXPR\r
188 #   undef AUX778076_IS_LE_TYPEDEF\r
189 #   undef AUX778076_LAMBDA_TYPEDEF\r
190 \r
191 #undef i_\r
192 \r
193 #endif // BOOST_PP_IS_ITERATING\r