Back to home page

EIC code displayed by LXR

 
 

    


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

0001 
0002 // Copyright Aleksey Gurtovoy 2000-2006
0003 //
0004 // Distributed under the Boost Software License, Version 1.0. 
0005 // (See accompanying file LICENSE_1_0.txt or copy at 
0006 // http://www.boost.org/LICENSE_1_0.txt)
0007 //
0008 // See http://www.boost.org/libs/mpl for documentation.
0009 
0010 // $Id$
0011 // $Date$
0012 // $Revision$
0013 
0014 // NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION!
0015 
0016 #include <boost/mpl/integral_c_tag.hpp>
0017 #include <boost/mpl/aux_/static_cast.hpp>
0018 #include <boost/mpl/aux_/nttp_decl.hpp>
0019 #include <boost/mpl/aux_/config/static_constant.hpp>
0020 #include <boost/mpl/aux_/config/workaround.hpp>
0021 
0022 #include <boost/preprocessor/cat.hpp>
0023 
0024 #if !defined(AUX_WRAPPER_NAME)
0025 #   define AUX_WRAPPER_NAME BOOST_PP_CAT(AUX_WRAPPER_VALUE_TYPE,_)
0026 #endif
0027 
0028 #if !defined(AUX_WRAPPER_PARAMS)
0029 #   define AUX_WRAPPER_PARAMS(N) BOOST_MPL_AUX_NTTP_DECL(AUX_WRAPPER_VALUE_TYPE, N)
0030 #endif
0031 
0032 #if !defined(AUX_WRAPPER_INST)
0033 #   if BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
0034 #       define AUX_WRAPPER_INST(value) AUX_WRAPPER_NAME< value >
0035 #   else 
0036 #       define AUX_WRAPPER_INST(value) BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::AUX_WRAPPER_NAME< value >
0037 #   endif
0038 #endif
0039 
0040 BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
0041 
0042 template< AUX_WRAPPER_PARAMS(N) >
0043 struct AUX_WRAPPER_NAME
0044 {
0045     BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, value = N);
0046 // agurt, 08/mar/03: SGI MIPSpro C++ workaround, have to #ifdef because some 
0047 // other compilers (e.g. MSVC) are not particulary happy about it
0048 #if BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
0049     typedef struct AUX_WRAPPER_NAME type;
0050 #else
0051     typedef AUX_WRAPPER_NAME type;
0052 #endif
0053     typedef AUX_WRAPPER_VALUE_TYPE value_type;
0054     typedef integral_c_tag tag;
0055 
0056 // have to #ifdef here: some compilers don't like the 'N + 1' form (MSVC),
0057 // while some other don't like 'value + 1' (Borland), and some don't like
0058 // either
0059 #if BOOST_WORKAROUND(__EDG_VERSION__, <= 243)
0060  private:
0061     BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, next_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)));
0062     BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, prior_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)));
0063  public:
0064     typedef AUX_WRAPPER_INST(next_value) next;
0065     typedef AUX_WRAPPER_INST(prior_value) prior;
0066 #elif BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x561)) \
0067     || BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(502)) \
0068     || (BOOST_WORKAROUND(__HP_aCC, <= 53800) && (BOOST_WORKAROUND(__hpxstd98, != 1)))
0069     typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)) ) next;
0070     typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)) ) prior;
0071 #else
0072     typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value + 1)) ) next;
0073     typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
0074 #endif
0075 
0076     // enables uniform function call syntax for families of overloaded 
0077     // functions that return objects of both arithmetic ('int', 'long',
0078     // 'double', etc.) and wrapped integral types (for an example, see 
0079     // "mpl/example/power.cpp")
0080     BOOST_CONSTEXPR operator AUX_WRAPPER_VALUE_TYPE() const { return static_cast<AUX_WRAPPER_VALUE_TYPE>(this->value); } 
0081 };
0082 
0083 #if !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION)
0084 template< AUX_WRAPPER_PARAMS(N) >
0085 AUX_WRAPPER_VALUE_TYPE const AUX_WRAPPER_INST(N)::value;
0086 #endif
0087 
0088 BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
0089 
0090 #undef AUX_WRAPPER_NAME
0091 #undef AUX_WRAPPER_PARAMS
0092 #undef AUX_WRAPPER_INST
0093 #undef AUX_WRAPPER_VALUE_TYPE