Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 1 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 2 | #ifndef NDNBOOST_MPL_AUX_VALUE_WKND_HPP_INCLUDED |
| 3 | #define NDNBOOST_MPL_AUX_VALUE_WKND_HPP_INCLUDED |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 4 | |
| 5 | // Copyright Aleksey Gurtovoy 2000-2004 |
| 6 | // |
| 7 | // Distributed under the Boost Software License, Version 1.0. |
| 8 | // (See accompanying file LICENSE_1_0.txt or copy at |
| 9 | // http://www.boost.org/LICENSE_1_0.txt) |
| 10 | // |
| 11 | // See http://www.boost.org/libs/mpl for documentation. |
| 12 | |
| 13 | // $Id: value_wknd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ |
| 14 | // $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $ |
| 15 | // $Revision: 49267 $ |
| 16 | |
Jeff Thompson | 2277ce5 | 2013-08-01 17:34:11 -0700 | [diff] [blame] | 17 | #include <ndnboost/mpl/aux_/static_cast.hpp> |
| 18 | #include <ndnboost/mpl/aux_/config/integral.hpp> |
| 19 | #include <ndnboost/mpl/aux_/config/eti.hpp> |
| 20 | #include <ndnboost/mpl/aux_/config/workaround.hpp> |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 21 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 22 | #if defined(NDNBOOST_MPL_CFG_BCC_INTEGRAL_CONSTANTS) \ |
| 23 | || defined(NDNBOOST_MPL_CFG_MSVC_60_ETI_BUG) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 24 | |
Jeff Thompson | 2277ce5 | 2013-08-01 17:34:11 -0700 | [diff] [blame] | 25 | # include <ndnboost/mpl/int.hpp> |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 26 | |
| 27 | namespace ndnboost { namespace mpl { namespace aux { |
| 28 | template< typename C_ > struct value_wknd |
| 29 | : C_ |
| 30 | { |
| 31 | }; |
| 32 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 33 | #if defined(NDNBOOST_MPL_CFG_MSVC_60_ETI_BUG) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 34 | template<> struct value_wknd<int> |
| 35 | : int_<1> |
| 36 | { |
| 37 | using int_<1>::value; |
| 38 | }; |
| 39 | #endif |
| 40 | }}} |
| 41 | |
| 42 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 43 | #if !defined(NDNBOOST_MPL_CFG_MSVC_60_ETI_BUG) |
| 44 | # define NDNBOOST_MPL_AUX_VALUE_WKND(C) \ |
| 45 | ::NDNBOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::aux::value_wknd< C > \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 46 | /**/ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 47 | # define NDNBOOST_MPL_AUX_MSVC_VALUE_WKND(C) NDNBOOST_MPL_AUX_VALUE_WKND(C) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 48 | #else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 49 | # define NDNBOOST_MPL_AUX_VALUE_WKND(C) C |
| 50 | # define NDNBOOST_MPL_AUX_MSVC_VALUE_WKND(C) \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 51 | ::ndnboost::mpl::aux::value_wknd< C > \ |
| 52 | /**/ |
| 53 | #endif |
| 54 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 55 | #else // NDNBOOST_MPL_CFG_BCC_INTEGRAL_CONSTANTS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 56 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 57 | # define NDNBOOST_MPL_AUX_VALUE_WKND(C) C |
| 58 | # define NDNBOOST_MPL_AUX_MSVC_VALUE_WKND(C) C |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 59 | |
| 60 | #endif |
| 61 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 62 | #if NDNBOOST_WORKAROUND(__EDG_VERSION__, <= 238) |
| 63 | # define NDNBOOST_MPL_AUX_NESTED_VALUE_WKND(T, C) \ |
| 64 | NDNBOOST_MPL_AUX_STATIC_CAST(T, C::value) \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 65 | /**/ |
| 66 | #else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 67 | # define NDNBOOST_MPL_AUX_NESTED_VALUE_WKND(T, C) \ |
| 68 | NDNBOOST_MPL_AUX_VALUE_WKND(C)::value \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 69 | /**/ |
| 70 | #endif |
| 71 | |
| 72 | |
| 73 | namespace ndnboost { namespace mpl { namespace aux { |
| 74 | |
| 75 | template< typename T > struct value_type_wknd |
| 76 | { |
| 77 | typedef typename T::value_type type; |
| 78 | }; |
| 79 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 80 | #if defined(NDNBOOST_MPL_CFG_MSVC_ETI_BUG) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 81 | template<> struct value_type_wknd<int> |
| 82 | { |
| 83 | typedef int type; |
| 84 | }; |
| 85 | #endif |
| 86 | |
| 87 | }}} |
| 88 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 89 | #endif // NDNBOOST_MPL_AUX_VALUE_WKND_HPP_INCLUDED |