integral_wrapper.hpp
Go to the documentation of this file.
1 
2 // Copyright Aleksey Gurtovoy 2000-2006
3 //
4 // Distributed under the Boost Software License, Version 1.0.
5 // (See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
7 //
8 // See http://www.boost.org/libs/mpl for documentation.
9 
10 // $Id$
11 // $Date$
12 // $Revision$
13 
14 // NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION!
15 
16 #include "../integral_c_tag.hpp"
17 #include "static_cast.hpp"
18 #include "nttp_decl.hpp"
20 #include "config/workaround.hpp"
21 
23 
24 #if !defined(AUX_WRAPPER_NAME)
25 # define AUX_WRAPPER_NAME BOOST_PP_CAT(AUX_WRAPPER_VALUE_TYPE,_)
26 #endif
27 
28 #if !defined(AUX_WRAPPER_PARAMS)
29 # define AUX_WRAPPER_PARAMS(N) BOOST_MPL_AUX_NTTP_DECL(AUX_WRAPPER_VALUE_TYPE, N)
30 #endif
31 
32 #if !defined(AUX_WRAPPER_INST)
33 # if BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
34 # define AUX_WRAPPER_INST(value) AUX_WRAPPER_NAME< value >
35 # else
36 # define AUX_WRAPPER_INST(value) BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::AUX_WRAPPER_NAME< value >
37 # endif
38 #endif
39 
41 
42 template< AUX_WRAPPER_PARAMS(N) >
44 {
46 // agurt, 08/mar/03: SGI MIPSpro C++ workaround, have to #ifdef because some
47 // other compilers (e.g. MSVC) are not particulary happy about it
48 #if BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
49  typedef struct AUX_WRAPPER_NAME type;
50 #else
52 #endif
55 
56 // have to #ifdef here: some compilers don't like the 'N + 1' form (MSVC),
57 // while some other don't like 'value + 1' (Borland), and some don't like
58 // either
59 #if BOOST_WORKAROUND(__EDG_VERSION__, <= 243)
60  private:
63  public:
64  typedef AUX_WRAPPER_INST(next_value) next;
65  typedef AUX_WRAPPER_INST(prior_value) prior;
66 #elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
67  || BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(502)) \
68  || (BOOST_WORKAROUND(__HP_aCC, <= 53800) && (BOOST_WORKAROUND(__hpxstd98, != 1)))
71 #else
72  typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value + 1)) ) next;
73  typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
74 #endif
75 
76  // enables uniform function call syntax for families of overloaded
77  // functions that return objects of both arithmetic ('int', 'long',
78  // 'double', etc.) and wrapped integral types (for an example, see
79  // "mpl/example/power.cpp")
80  BOOST_CONSTEXPR operator AUX_WRAPPER_VALUE_TYPE() const { return static_cast<AUX_WRAPPER_VALUE_TYPE>(this->value); }
81 };
82 
83 #if !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION)
84 template< AUX_WRAPPER_PARAMS(N) >
85 AUX_WRAPPER_VALUE_TYPE const AUX_WRAPPER_INST(N)::value;
86 #endif
87 
89 
90 #undef AUX_WRAPPER_NAME
91 #undef AUX_WRAPPER_PARAMS
92 #undef AUX_WRAPPER_INST
93 #undef AUX_WRAPPER_VALUE_TYPE
BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, value=N)
#define BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
Definition: adl_barrier.hpp:24
GLfloat value
typedef AUX_WRAPPER_INST(BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE,(value+1))) next
integral_c_tag tag
AUX_WRAPPER_VALUE_TYPE value_type
#define BOOST_MPL_AUX_STATIC_CAST(T, expr)
Definition: static_cast.hpp:24
void next(auto_any_t cur, type2type< T, C > *)
Definition: foreach.hpp:757
#define BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
Definition: adl_barrier.hpp:25
T prior(T x)
Definition: next_prior.hpp:155
#define AUX_WRAPPER_VALUE_TYPE
Definition: int.hpp:19
AUX_WRAPPER_NAME type
#define BOOST_CONSTEXPR
Definition: suffix.hpp:939


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:17