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

Private GIT Repository
ffec3f8e76e02fc8bf4824d1abc503d5c9d24881
[canny.git] / stc / exp / ml_stc_linux_make_v1.0 / include / boost / mpl / quote.hpp
1 \r
2 #if !defined(BOOST_PP_IS_ITERATING)\r
3 \r
4 ///// header body\r
5 \r
6 #ifndef BOOST_MPL_QUOTE_HPP_INCLUDED\r
7 #define BOOST_MPL_QUOTE_HPP_INCLUDED\r
8 \r
9 // Copyright Aleksey Gurtovoy 2000-2008\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: quote.hpp 49272 2008-10-11 06:50:46Z agurtovoy $\r
18 // $Date: 2008-10-11 02:50:46 -0400 (Sat, 11 Oct 2008) $\r
19 // $Revision: 49272 $\r
20 \r
21 #if !defined(BOOST_MPL_PREPROCESSING_MODE)\r
22 #   include <boost/mpl/void.hpp>\r
23 #   include <boost/mpl/aux_/has_type.hpp>\r
24 #endif\r
25 \r
26 #include <boost/mpl/aux_/config/bcc.hpp>\r
27 #include <boost/mpl/aux_/config/ttp.hpp>\r
28 \r
29 #if defined(BOOST_MPL_CFG_NO_TEMPLATE_TEMPLATE_PARAMETERS) \\r
30     && !defined(BOOST_MPL_CFG_BCC590_WORKAROUNDS)\r
31 #   define BOOST_MPL_CFG_NO_QUOTE_TEMPLATE\r
32 #endif\r
33 \r
34 #if !defined(BOOST_MPL_CFG_NO_IMPLICIT_METAFUNCTIONS) \\r
35     && defined(BOOST_MPL_CFG_NO_HAS_XXX)\r
36 #   define BOOST_MPL_CFG_NO_IMPLICIT_METAFUNCTIONS\r
37 #endif\r
38 \r
39 #include <boost/mpl/aux_/config/use_preprocessed.hpp>\r
40 \r
41 #if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \\r
42  && !defined(BOOST_MPL_PREPROCESSING_MODE)\r
43 \r
44 #   define BOOST_MPL_PREPROCESSED_HEADER quote.hpp\r
45 #   include <boost/mpl/aux_/include_preprocessed.hpp>\r
46 \r
47 #else\r
48 \r
49 #   include <boost/mpl/limits/arity.hpp>\r
50 #   include <boost/mpl/aux_/preprocessor/params.hpp>\r
51 #   include <boost/mpl/aux_/config/ctps.hpp>\r
52 #   include <boost/mpl/aux_/config/workaround.hpp>\r
53 \r
54 #   include <boost/preprocessor/iterate.hpp>\r
55 #   include <boost/preprocessor/cat.hpp>\r
56 \r
57 #if !defined(BOOST_MPL_CFG_NO_QUOTE_TEMPLATE)\r
58 \r
59 namespace boost { namespace mpl {\r
60 \r
61 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)\r
62 \r
63 template< typename T, bool has_type_ >\r
64 struct quote_impl\r
65 // GCC has a problem with metafunction forwarding when T is a\r
66 // specialization of a template called 'type'.\r
67 # if BOOST_WORKAROUND(__GNUC__, BOOST_TESTED_AT(4)) \\r
68     && BOOST_WORKAROUND(__GNUC_MINOR__, BOOST_TESTED_AT(0)) \\r
69     && BOOST_WORKAROUND(__GNUC_PATCHLEVEL__, BOOST_TESTED_AT(2))\r
70 {\r
71     typedef typename T::type type;\r
72 };\r
73 # else \r
74     : T\r
75 {\r
76 };\r
77 # endif \r
78 \r
79 template< typename T >\r
80 struct quote_impl<T,false>\r
81 {\r
82     typedef T type;\r
83 };\r
84 \r
85 #else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION\r
86 \r
87 template< bool > struct quote_impl\r
88 {\r
89     template< typename T > struct result_\r
90         : T\r
91     {\r
92     };\r
93 };\r
94 \r
95 template<> struct quote_impl<false>\r
96 {\r
97     template< typename T > struct result_\r
98     {\r
99         typedef T type;\r
100     };\r
101 };\r
102 \r
103 #endif \r
104 \r
105 #define BOOST_PP_ITERATION_PARAMS_1 \\r
106     (3,(1, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, <boost/mpl/quote.hpp>))\r
107 #include BOOST_PP_ITERATE()\r
108 \r
109 }}\r
110 \r
111 #endif // BOOST_MPL_CFG_NO_QUOTE_TEMPLATE\r
112 \r
113 #endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS\r
114 #endif // BOOST_MPL_QUOTE_HPP_INCLUDED\r
115 \r
116 ///// iteration\r
117 \r
118 #else\r
119 #define i_ BOOST_PP_FRAME_ITERATION(1)\r
120 \r
121 template<\r
122       template< BOOST_MPL_PP_PARAMS(i_, typename P) > class F\r
123     , typename Tag = void_\r
124     >\r
125 struct BOOST_PP_CAT(quote,i_)\r
126 {\r
127     template< BOOST_MPL_PP_PARAMS(i_, typename U) > struct apply\r
128 #if defined(BOOST_MPL_CFG_BCC590_WORKAROUNDS)\r
129     {\r
130         typedef typename quote_impl<\r
131               F< BOOST_MPL_PP_PARAMS(i_, U) >\r
132             , aux::has_type< F< BOOST_MPL_PP_PARAMS(i_, U) > >::value\r
133             >::type type;\r
134     };\r
135 #elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)\r
136         : quote_impl<\r
137               F< BOOST_MPL_PP_PARAMS(i_, U) >\r
138             , aux::has_type< F< BOOST_MPL_PP_PARAMS(i_, U) > >::value\r
139             >\r
140     {\r
141     };\r
142 #else\r
143         : quote_impl< aux::has_type< F< BOOST_MPL_PP_PARAMS(i_, U) > >::value >\r
144             ::template result_< F< BOOST_MPL_PP_PARAMS(i_, U) > >\r
145     {\r
146     };\r
147 #endif\r
148 };\r
149 \r
150 #undef i_\r
151 #endif // BOOST_PP_IS_ITERATING\r