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

Private GIT Repository
a27e32af97e595ca63d7a2044df3c2a3c8fb3e2b
[canny.git] / stc / exp / ml_stc_linux_make_v1.0 / include / boost / mpl / aux_ / inserter_algorithm.hpp
1 \r
2 #ifndef BOOST_MPL_AUX_INSERTER_ALGORITHM_HPP_INCLUDED\r
3 #define BOOST_MPL_AUX_INSERTER_ALGORITHM_HPP_INCLUDED\r
4 \r
5 // Copyright Aleksey Gurtovoy 2003-2004\r
6 // Copyright David Abrahams 2003-2004\r
7 //\r
8 // Distributed under the Boost Software License, Version 1.0. \r
9 // (See accompanying file LICENSE_1_0.txt or copy at \r
10 // http://www.boost.org/LICENSE_1_0.txt)\r
11 //\r
12 // See http://www.boost.org/libs/mpl for documentation.\r
13 \r
14 // $Id: inserter_algorithm.hpp 55648 2009-08-18 05:16:53Z agurtovoy $\r
15 // $Date: 2009-08-18 01:16:53 -0400 (Tue, 18 Aug 2009) $\r
16 // $Revision: 55648 $\r
17 \r
18 #include <boost/mpl/back_inserter.hpp>\r
19 #include <boost/mpl/front_inserter.hpp>\r
20 #include <boost/mpl/push_back.hpp>\r
21 #include <boost/mpl/push_front.hpp>\r
22 #include <boost/mpl/back_inserter.hpp>\r
23 #include <boost/mpl/front_inserter.hpp>\r
24 #include <boost/mpl/clear.hpp>\r
25 #include <boost/mpl/eval_if.hpp>\r
26 #include <boost/mpl/if.hpp>\r
27 #include <boost/mpl/aux_/na.hpp>\r
28 #include <boost/mpl/aux_/common_name_wknd.hpp>\r
29 #include <boost/mpl/aux_/na_spec.hpp>\r
30 #include <boost/mpl/aux_/preprocessor/params.hpp>\r
31 #include <boost/mpl/aux_/preprocessor/default_params.hpp>\r
32 #include <boost/mpl/aux_/config/ctps.hpp>\r
33 \r
34 #include <boost/preprocessor/arithmetic/dec.hpp>\r
35 \r
36 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)\r
37 \r
38 #   define BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(arity, name) \\r
39 BOOST_MPL_AUX_COMMON_NAME_WKND(name) \\r
40 template< \\r
41       BOOST_MPL_PP_DEFAULT_PARAMS(arity, typename P, na) \\r
42     > \\r
43 struct name \\r
44     : aux::name##_impl<BOOST_MPL_PP_PARAMS(arity, P)> \\r
45 { \\r
46 }; \\r
47 \\r
48 template< \\r
49       BOOST_MPL_PP_PARAMS(BOOST_PP_DEC(arity), typename P) \\r
50     > \\r
51 struct name< BOOST_MPL_PP_PARAMS(BOOST_PP_DEC(arity), P),na > \\r
52     : if_< has_push_back< typename clear<P1>::type> \\r
53         , aux::name##_impl< \\r
54               BOOST_MPL_PP_PARAMS(BOOST_PP_DEC(arity), P) \\r
55             , back_inserter< typename clear<P1>::type > \\r
56             > \\r
57         , aux::reverse_##name##_impl< \\r
58               BOOST_MPL_PP_PARAMS(BOOST_PP_DEC(arity), P) \\r
59             , front_inserter< typename clear<P1>::type > \\r
60             > \\r
61         >::type \\r
62 { \\r
63 }; \\r
64 \\r
65 template< \\r
66       BOOST_MPL_PP_DEFAULT_PARAMS(arity, typename P, na) \\r
67     > \\r
68 struct reverse_##name \\r
69     : aux::reverse_##name##_impl<BOOST_MPL_PP_PARAMS(arity, P)> \\r
70 { \\r
71 }; \\r
72 \\r
73 template< \\r
74       BOOST_MPL_PP_PARAMS(BOOST_PP_DEC(arity), typename P) \\r
75     > \\r
76 struct reverse_##name< BOOST_MPL_PP_PARAMS(BOOST_PP_DEC(arity), P),na > \\r
77     : if_< has_push_back<P1> \\r
78         , aux::reverse_##name##_impl< \\r
79               BOOST_MPL_PP_PARAMS(BOOST_PP_DEC(arity), P) \\r
80             , back_inserter< typename clear<P1>::type > \\r
81             > \\r
82         , aux::name##_impl< \\r
83               BOOST_MPL_PP_PARAMS(BOOST_PP_DEC(arity), P) \\r
84             , front_inserter< typename clear<P1>::type > \\r
85             > \\r
86         >::type \\r
87 { \\r
88 }; \\r
89 BOOST_MPL_AUX_NA_SPEC(arity, name) \\r
90 BOOST_MPL_AUX_NA_SPEC(arity, reverse_##name) \\r
91 /**/\r
92 \r
93 #else\r
94 \r
95 #   define BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(arity, name) \\r
96 BOOST_MPL_AUX_COMMON_NAME_WKND(name) \\r
97 template< \\r
98       BOOST_MPL_PP_PARAMS(BOOST_PP_DEC(arity), typename P) \\r
99     > \\r
100 struct def_##name##_impl \\r
101     : if_< has_push_back<P1> \\r
102         , aux::name##_impl< \\r
103               BOOST_MPL_PP_PARAMS(BOOST_PP_DEC(arity), P) \\r
104             , back_inserter< typename clear<P1>::type > \\r
105             > \\r
106         , aux::reverse_##name##_impl< \\r
107               BOOST_MPL_PP_PARAMS(BOOST_PP_DEC(arity), P) \\r
108             , front_inserter< typename clear<P1>::type > \\r
109             > \\r
110         >::type \\r
111 { \\r
112 }; \\r
113 \\r
114 template< \\r
115       BOOST_MPL_PP_DEFAULT_PARAMS(arity, typename P, na) \\r
116     > \\r
117 struct name \\r
118 { \\r
119     typedef typename eval_if< \\r
120           is_na<BOOST_PP_CAT(P, arity)> \\r
121         , def_##name##_impl<BOOST_MPL_PP_PARAMS(BOOST_PP_DEC(arity), P)> \\r
122         , aux::name##_impl<BOOST_MPL_PP_PARAMS(arity, P)> \\r
123         >::type type; \\r
124 }; \\r
125 \\r
126 template< \\r
127       BOOST_MPL_PP_PARAMS(BOOST_PP_DEC(arity), typename P) \\r
128     > \\r
129 struct def_reverse_##name##_impl \\r
130     : if_< has_push_back<P1> \\r
131         , aux::reverse_##name##_impl< \\r
132               BOOST_MPL_PP_PARAMS(BOOST_PP_DEC(arity), P) \\r
133             , back_inserter< typename clear<P1>::type > \\r
134             > \\r
135         , aux::name##_impl< \\r
136               BOOST_MPL_PP_PARAMS(BOOST_PP_DEC(arity), P) \\r
137             , front_inserter< typename clear<P1>::type > \\r
138             > \\r
139         >::type \\r
140 { \\r
141 }; \\r
142 template< \\r
143       BOOST_MPL_PP_DEFAULT_PARAMS(arity, typename P, na) \\r
144     > \\r
145 struct reverse_##name \\r
146 { \\r
147     typedef typename eval_if< \\r
148           is_na<BOOST_PP_CAT(P, arity)> \\r
149         , def_reverse_##name##_impl<BOOST_MPL_PP_PARAMS(BOOST_PP_DEC(arity), P)> \\r
150         , aux::reverse_##name##_impl<BOOST_MPL_PP_PARAMS(arity, P)> \\r
151         >::type type; \\r
152 }; \\r
153 BOOST_MPL_AUX_NA_SPEC(arity, name) \\r
154 BOOST_MPL_AUX_NA_SPEC(arity, reverse_##name) \\r
155 /**/\r
156 \r
157 #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION\r
158 \r
159 #endif // BOOST_MPL_AUX_INSERTER_ALGORITHM_HPP_INCLUDED\r