epoc32/include/stdapis/boost/mpl/aux_/integral_wrapper.hpp
branchSymbian2
changeset 2 2fe1408b6811
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/stdapis/boost/mpl/aux_/integral_wrapper.hpp	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,93 @@
     1.4 +
     1.5 +// Copyright Aleksey Gurtovoy 2000-2006
     1.6 +//
     1.7 +// Distributed under the Boost Software License, Version 1.0. 
     1.8 +// (See accompanying file LICENSE_1_0.txt or copy at 
     1.9 +// http://www.boost.org/LICENSE_1_0.txt)
    1.10 +//
    1.11 +// See http://www.boost.org/libs/mpl for documentation.
    1.12 +
    1.13 +// $Source: /cvsroot/boost/boost/boost/mpl/aux_/integral_wrapper.hpp,v $
    1.14 +// $Date: 2006/11/08 21:44:30 $
    1.15 +// $Revision: 1.10.14.1 $
    1.16 +
    1.17 +// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION!
    1.18 +
    1.19 +#include <boost/mpl/integral_c_tag.hpp>
    1.20 +#include <boost/mpl/aux_/static_cast.hpp>
    1.21 +#include <boost/mpl/aux_/nttp_decl.hpp>
    1.22 +#include <boost/mpl/aux_/config/static_constant.hpp>
    1.23 +#include <boost/mpl/aux_/config/workaround.hpp>
    1.24 +
    1.25 +#include <boost/preprocessor/cat.hpp>
    1.26 +
    1.27 +#if !defined(AUX_WRAPPER_NAME)
    1.28 +#   define AUX_WRAPPER_NAME BOOST_PP_CAT(AUX_WRAPPER_VALUE_TYPE,_)
    1.29 +#endif
    1.30 +
    1.31 +#if !defined(AUX_WRAPPER_PARAMS)
    1.32 +#   define AUX_WRAPPER_PARAMS(N) BOOST_MPL_AUX_NTTP_DECL(AUX_WRAPPER_VALUE_TYPE, N)
    1.33 +#endif
    1.34 +
    1.35 +#if !defined(AUX_WRAPPER_INST)
    1.36 +#   if BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
    1.37 +#       define AUX_WRAPPER_INST(value) AUX_WRAPPER_NAME< value >
    1.38 +#   else 
    1.39 +#       define AUX_WRAPPER_INST(value) BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::AUX_WRAPPER_NAME< value >
    1.40 +#   endif
    1.41 +#endif
    1.42 +
    1.43 +BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
    1.44 +
    1.45 +template< AUX_WRAPPER_PARAMS(N) >
    1.46 +struct AUX_WRAPPER_NAME
    1.47 +{
    1.48 +    BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, value = N);
    1.49 +// agurt, 08/mar/03: SGI MIPSpro C++ workaround, have to #ifdef because some 
    1.50 +// other compilers (e.g. MSVC) are not particulary happy about it
    1.51 +#if BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
    1.52 +    typedef struct AUX_WRAPPER_NAME type;
    1.53 +#else
    1.54 +    typedef AUX_WRAPPER_NAME type;
    1.55 +#endif
    1.56 +    typedef AUX_WRAPPER_VALUE_TYPE value_type;
    1.57 +    typedef integral_c_tag tag;
    1.58 +
    1.59 +// have to #ifdef here: some compilers don't like the 'N + 1' form (MSVC),
    1.60 +// while some other don't like 'value + 1' (Borland), and some don't like
    1.61 +// either
    1.62 +#if BOOST_WORKAROUND(__EDG_VERSION__, <= 243)
    1.63 + private:
    1.64 +    BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, next_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)));
    1.65 +    BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, prior_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)));
    1.66 + public:
    1.67 +    typedef AUX_WRAPPER_INST(next_value) next;
    1.68 +    typedef AUX_WRAPPER_INST(prior_value) prior;
    1.69 +#elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
    1.70 +    || BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(502)) \
    1.71 +    || BOOST_WORKAROUND(__HP_aCC, <= 53800)
    1.72 +    typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)) ) next;
    1.73 +    typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)) ) prior;
    1.74 +#else
    1.75 +    typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value + 1)) ) next;
    1.76 +    typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
    1.77 +#endif
    1.78 +
    1.79 +    // enables uniform function call syntax for families of overloaded 
    1.80 +    // functions that return objects of both arithmetic ('int', 'long',
    1.81 +    // 'double', etc.) and wrapped integral types (for an example, see 
    1.82 +    // "mpl/example/power.cpp")
    1.83 +    operator AUX_WRAPPER_VALUE_TYPE() const { return static_cast<AUX_WRAPPER_VALUE_TYPE>(this->value); } 
    1.84 +};
    1.85 +
    1.86 +#if !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION)
    1.87 +template< AUX_WRAPPER_PARAMS(N) >
    1.88 +AUX_WRAPPER_VALUE_TYPE const AUX_WRAPPER_INST(N)::value;
    1.89 +#endif
    1.90 +
    1.91 +BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
    1.92 +
    1.93 +#undef AUX_WRAPPER_NAME
    1.94 +#undef AUX_WRAPPER_PARAMS
    1.95 +#undef AUX_WRAPPER_INST
    1.96 +#undef AUX_WRAPPER_VALUE_TYPE