Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:41:38

0001 
0002 // NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION
0003 
0004 #if !defined(BOOST_PP_IS_ITERATING)
0005 
0006 ///// header body
0007 
0008 // Copyright Aleksey Gurtovoy 2000-2008
0009 //
0010 // Distributed under the Boost Software License, Version 1.0. 
0011 // (See accompanying file LICENSE_1_0.txt or copy at 
0012 // http://www.boost.org/LICENSE_1_0.txt)
0013 //
0014 // See http://www.boost.org/libs/mpl for documentation.
0015 
0016 // $Id$
0017 // $Date$
0018 // $Revision$
0019 
0020 #   include <boost/mpl/aux_/config/ctps.hpp>
0021 #   include <boost/mpl/aux_/config/static_constant.hpp>
0022 #   include <boost/mpl/aux_/nttp_decl.hpp>
0023 
0024 #   include <boost/preprocessor/arithmetic/sub.hpp>
0025 #   include <boost/preprocessor/tuple/elem.hpp>
0026 #   include <boost/preprocessor/enum_params_with_a_default.hpp>
0027 #   include <boost/preprocessor/enum_params.hpp>
0028 #   include <boost/preprocessor/enum.hpp>
0029 #   include <boost/preprocessor/repeat.hpp>
0030 #   include <boost/preprocessor/comma_if.hpp>
0031 #   include <boost/preprocessor/iterate.hpp>
0032 
0033 #if defined(BOOST_MPL_PREPROCESSING_MODE)
0034 #   undef LONG_MAX
0035 #endif
0036 
0037 namespace boost { namespace mpl {
0038 
0039 #if !defined(AUX778076_SEQUENCE_BASE_NAME)
0040 #   define AUX778076_SEQUENCE_BASE_NAME AUX778076_SEQUENCE_NAME
0041 #endif
0042 
0043 #if !defined(AUX778076_SEQUENCE_INTEGRAL_WRAPPER)
0044 
0045 #   define AUX778076_SEQUENCE_PARAM_NAME T
0046 #   define AUX778076_SEQUENCE_TEMPLATE_PARAM typename T
0047 #   define AUX778076_SEQUENCE_DEFAULT na
0048 
0049 #   define AUX778076_SEQUENCE_NAME_N(n) \
0050     BOOST_PP_CAT(AUX778076_SEQUENCE_BASE_NAME,n) \
0051     /**/
0052 
0053 #   define AUX778076_SEQUENCE_PARAMS() \
0054     BOOST_PP_ENUM_PARAMS( \
0055           AUX778076_SEQUENCE_LIMIT \
0056         , AUX778076_SEQUENCE_TEMPLATE_PARAM \
0057         ) \
0058     /**/
0059 
0060 #   define AUX778076_SEQUENCE_ARGS() \
0061     BOOST_PP_ENUM_PARAMS( \
0062           AUX778076_SEQUENCE_LIMIT \
0063         , T \
0064         ) \
0065     /**/
0066 
0067 #   define AUX778076_SEQUENCE_DEFAULT_PARAMS() \
0068      BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( \
0069           AUX778076_SEQUENCE_LIMIT \
0070         , AUX778076_SEQUENCE_TEMPLATE_PARAM \
0071         , AUX778076_SEQUENCE_DEFAULT \
0072         ) \
0073     /**/
0074 
0075 #   define AUX778076_SEQUENCE_N_PARAMS(n) \
0076     BOOST_PP_ENUM_PARAMS(n, AUX778076_SEQUENCE_TEMPLATE_PARAM) \
0077     /**/
0078 
0079 #   define AUX778076_SEQUENCE_N_ARGS(n) \
0080     BOOST_PP_ENUM_PARAMS(n, T) \
0081     /**/
0082 
0083 #   define AUX778076_SEQUENCE_N_PARTIAL_SPEC_ARGS(n) \
0084     BOOST_PP_ENUM_PARAMS(n, T) \
0085     BOOST_PP_COMMA_IF(n) \
0086     BOOST_PP_ENUM( \
0087           BOOST_PP_SUB_D(1,AUX778076_SEQUENCE_LIMIT,n) \
0088         , BOOST_PP_TUPLE_ELEM_3_2 \
0089         , AUX778076_SEQUENCE_DEFAULT \
0090         ) \
0091     /**/
0092 
0093 #else // AUX778076_SEQUENCE_INTEGRAL_WRAPPER
0094 
0095 #   define AUX778076_SEQUENCE_PARAM_NAME C
0096 #   define AUX778076_SEQUENCE_TEMPLATE_PARAM BOOST_MPL_AUX_NTTP_DECL(long, C)
0097 #   define AUX778076_SEQUENCE_DEFAULT LONG_MAX
0098 
0099 #   define AUX778076_SEQUENCE_PARAMS() \
0100     typename T, BOOST_PP_ENUM_PARAMS( \
0101           AUX778076_SEQUENCE_LIMIT \
0102         , AUX778076_SEQUENCE_TEMPLATE_PARAM \
0103         ) \
0104     /**/
0105 
0106 #   define AUX778076_SEQUENCE_ARGS() \
0107     T, BOOST_PP_ENUM_PARAMS( \
0108           AUX778076_SEQUENCE_LIMIT \
0109         , C \
0110         ) \
0111     /**/
0112 
0113 #   define AUX778076_SEQUENCE_DEFAULT_PARAMS() \
0114     typename T, \
0115     BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( \
0116           AUX778076_SEQUENCE_LIMIT \
0117         , AUX778076_SEQUENCE_TEMPLATE_PARAM \
0118         , AUX778076_SEQUENCE_DEFAULT \
0119         ) \
0120     /**/
0121 
0122 #   define AUX778076_SEQUENCE_N_PARAMS(n) \
0123     typename T BOOST_PP_COMMA_IF(n) \
0124     BOOST_PP_ENUM_PARAMS(n, AUX778076_SEQUENCE_TEMPLATE_PARAM) \
0125     /**/
0126 
0127 #   if !defined(AUX778076_SEQUENCE_CONVERT_CN_TO)
0128 #       define AUX778076_SEQUENCE_CONVERT_CN_TO(z,n,TARGET) BOOST_PP_CAT(C,n)
0129 #   endif
0130 
0131 #   define AUX778076_SEQUENCE_N_ARGS(n) \
0132     T BOOST_PP_COMMA_IF(n) \
0133     BOOST_PP_ENUM(n,AUX778076_SEQUENCE_CONVERT_CN_TO,T) \
0134     /**/
0135 
0136 #   define AUX778076_SEQUENCE_N_PARTIAL_SPEC_ARGS(n) \
0137     T, BOOST_PP_ENUM_PARAMS(n, C) \
0138     BOOST_PP_COMMA_IF(n) \
0139     BOOST_PP_ENUM( \
0140           BOOST_PP_SUB_D(1,AUX778076_SEQUENCE_LIMIT,n) \
0141         , BOOST_PP_TUPLE_ELEM_3_2 \
0142         , AUX778076_SEQUENCE_DEFAULT \
0143         ) \
0144     /**/
0145 
0146 #endif // AUX778076_SEQUENCE_INTEGRAL_WRAPPER
0147 
0148 
0149 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
0150 // forward declaration
0151 template<
0152       AUX778076_SEQUENCE_DEFAULT_PARAMS()
0153     >
0154 struct AUX778076_SEQUENCE_NAME;
0155 #else
0156 namespace aux {
0157 template< BOOST_MPL_AUX_NTTP_DECL(int, N) > 
0158 struct BOOST_PP_CAT(AUX778076_SEQUENCE_NAME,_chooser);
0159 }
0160 #endif
0161 
0162 #define BOOST_PP_ITERATION_PARAMS_1 \
0163     (3,(0, AUX778076_SEQUENCE_LIMIT, <boost/mpl/aux_/sequence_wrapper.hpp>))
0164 #include BOOST_PP_ITERATE()
0165 
0166 // real C++ version is already taken care of
0167 #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
0168 
0169 namespace aux {
0170 // ???_count_args
0171 #define AUX778076_COUNT_ARGS_PREFIX         AUX778076_SEQUENCE_NAME
0172 #define AUX778076_COUNT_ARGS_DEFAULT        AUX778076_SEQUENCE_DEFAULT
0173 #define AUX778076_COUNT_ARGS_PARAM_NAME     AUX778076_SEQUENCE_PARAM_NAME
0174 #define AUX778076_COUNT_ARGS_TEMPLATE_PARAM AUX778076_SEQUENCE_TEMPLATE_PARAM
0175 #define AUX778076_COUNT_ARGS_ARITY          AUX778076_SEQUENCE_LIMIT
0176 #define AUX778076_COUNT_ARGS_USE_STANDARD_PP_PRIMITIVES
0177 #include <boost/mpl/aux_/count_args.hpp>
0178 
0179 template<
0180       AUX778076_SEQUENCE_PARAMS()
0181     >
0182 struct BOOST_PP_CAT(AUX778076_SEQUENCE_NAME,_impl)
0183 {
0184     typedef aux::BOOST_PP_CAT(AUX778076_SEQUENCE_NAME,_count_args)<
0185           BOOST_PP_ENUM_PARAMS(AUX778076_SEQUENCE_LIMIT, AUX778076_SEQUENCE_PARAM_NAME)
0186         > arg_num_;
0187     
0188     typedef typename aux::BOOST_PP_CAT(AUX778076_SEQUENCE_NAME,_chooser)< arg_num_::value >
0189         ::template result_< AUX778076_SEQUENCE_ARGS() >::type type;
0190 };
0191 
0192 } // namespace aux
0193 
0194 template<
0195       AUX778076_SEQUENCE_DEFAULT_PARAMS()
0196     >
0197 struct AUX778076_SEQUENCE_NAME
0198     : aux::BOOST_PP_CAT(AUX778076_SEQUENCE_NAME,_impl)<
0199           AUX778076_SEQUENCE_ARGS()
0200         >::type
0201 {
0202     typedef typename aux::BOOST_PP_CAT(AUX778076_SEQUENCE_NAME,_impl)<
0203           AUX778076_SEQUENCE_ARGS()
0204         >::type type;
0205 };
0206 
0207 #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
0208 
0209 #   undef AUX778076_SEQUENCE_N_PARTIAL_SPEC_ARGS
0210 #   undef AUX778076_SEQUENCE_N_ARGS
0211 #   undef AUX778076_SEQUENCE_CONVERT_CN_TO
0212 #   undef AUX778076_SEQUENCE_N_PARAMS
0213 #   undef AUX778076_SEQUENCE_DEFAULT_PARAMS
0214 #   undef AUX778076_SEQUENCE_ARGS
0215 #   undef AUX778076_SEQUENCE_PARAMS
0216 #   undef AUX778076_SEQUENCE_NAME_N
0217 #   undef AUX778076_SEQUENCE_DEFAULT
0218 #   undef AUX778076_SEQUENCE_TEMPLATE_PARAM
0219 #   undef AUX778076_SEQUENCE_PARAM_NAME
0220 #   undef AUX778076_SEQUENCE_LIMIT
0221 #   undef AUX778076_SEQUENCE_BASE_NAME
0222 #   undef AUX778076_SEQUENCE_NAME
0223 #   undef AUX778076_SEQUENCE_INTEGRAL_WRAPPER
0224 
0225 }}
0226 
0227 ///// iteration
0228 
0229 #else
0230 #define i_ BOOST_PP_FRAME_ITERATION(1)
0231 
0232 #   if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
0233 
0234 #if i_ == AUX778076_SEQUENCE_LIMIT
0235 
0236 /// primary template (not a specialization!)
0237 template<
0238       AUX778076_SEQUENCE_N_PARAMS(i_)
0239     >
0240 struct AUX778076_SEQUENCE_NAME
0241     : AUX778076_SEQUENCE_NAME_N(i_)< AUX778076_SEQUENCE_N_ARGS(i_) >
0242 {
0243     typedef typename AUX778076_SEQUENCE_NAME_N(i_)< AUX778076_SEQUENCE_N_ARGS(i_) >::type type;
0244 };
0245 
0246 #else
0247 
0248 template<
0249       AUX778076_SEQUENCE_N_PARAMS(i_)
0250     >
0251 struct AUX778076_SEQUENCE_NAME< AUX778076_SEQUENCE_N_PARTIAL_SPEC_ARGS(i_) >
0252     : AUX778076_SEQUENCE_NAME_N(i_)< AUX778076_SEQUENCE_N_ARGS(i_) >
0253 {
0254 #if i_ > 0 || defined(AUX778076_SEQUENCE_INTEGRAL_WRAPPER)
0255     typedef typename AUX778076_SEQUENCE_NAME_N(i_)< AUX778076_SEQUENCE_N_ARGS(i_) >::type type;
0256 #else
0257     typedef AUX778076_SEQUENCE_NAME_N(i_)< AUX778076_SEQUENCE_N_ARGS(i_) >::type type;
0258 #endif
0259 };
0260 
0261 #endif // i_ == AUX778076_SEQUENCE_LIMIT
0262 
0263 #   else
0264 
0265 namespace aux {
0266 
0267 template<>
0268 struct BOOST_PP_CAT(AUX778076_SEQUENCE_NAME,_chooser)<i_>
0269 {
0270     template<
0271           AUX778076_SEQUENCE_PARAMS()
0272         >
0273     struct result_
0274     {
0275 #if i_ > 0 || defined(AUX778076_SEQUENCE_INTEGRAL_WRAPPER)
0276         typedef typename AUX778076_SEQUENCE_NAME_N(i_)<
0277               AUX778076_SEQUENCE_N_ARGS(i_)
0278             >::type type;
0279 #else
0280         typedef AUX778076_SEQUENCE_NAME_N(i_)<
0281               AUX778076_SEQUENCE_N_ARGS(i_)
0282             >::type type;
0283 #endif
0284     };
0285 };
0286 
0287 } // namespace aux
0288 
0289 #   endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
0290 
0291 #undef i_
0292 #endif // BOOST_PP_IS_ITERATING