blob: 0203baeed0b0da0ee8cae501b974643f1f4cda0c [file] [log] [blame]
Jeff Thompsonf7d49942013-08-01 16:47:40 -07001
Jeff Thompson3d613fd2013-10-15 15:39:04 -07002#ifndef NDNBOOST_MPL_AUX_VALUE_WKND_HPP_INCLUDED
3#define NDNBOOST_MPL_AUX_VALUE_WKND_HPP_INCLUDED
Jeff Thompsonf7d49942013-08-01 16:47:40 -07004
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 Thompson2277ce52013-08-01 17:34:11 -070017#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 Thompsonf7d49942013-08-01 16:47:40 -070021
Jeff Thompson3d613fd2013-10-15 15:39:04 -070022#if defined(NDNBOOST_MPL_CFG_BCC_INTEGRAL_CONSTANTS) \
23 || defined(NDNBOOST_MPL_CFG_MSVC_60_ETI_BUG)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070024
Jeff Thompson2277ce52013-08-01 17:34:11 -070025# include <ndnboost/mpl/int.hpp>
Jeff Thompsonf7d49942013-08-01 16:47:40 -070026
27namespace ndnboost { namespace mpl { namespace aux {
28template< typename C_ > struct value_wknd
29 : C_
30{
31};
32
Jeff Thompson3d613fd2013-10-15 15:39:04 -070033#if defined(NDNBOOST_MPL_CFG_MSVC_60_ETI_BUG)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070034template<> struct value_wknd<int>
35 : int_<1>
36{
37 using int_<1>::value;
38};
39#endif
40}}}
41
42
Jeff Thompson3d613fd2013-10-15 15:39:04 -070043#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 Thompsonf7d49942013-08-01 16:47:40 -070046/**/
Jeff Thompson3d613fd2013-10-15 15:39:04 -070047# define NDNBOOST_MPL_AUX_MSVC_VALUE_WKND(C) NDNBOOST_MPL_AUX_VALUE_WKND(C)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070048#else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070049# define NDNBOOST_MPL_AUX_VALUE_WKND(C) C
50# define NDNBOOST_MPL_AUX_MSVC_VALUE_WKND(C) \
Jeff Thompsonf7d49942013-08-01 16:47:40 -070051 ::ndnboost::mpl::aux::value_wknd< C > \
52/**/
53#endif
54
Jeff Thompson3d613fd2013-10-15 15:39:04 -070055#else // NDNBOOST_MPL_CFG_BCC_INTEGRAL_CONSTANTS
Jeff Thompsonf7d49942013-08-01 16:47:40 -070056
Jeff Thompson3d613fd2013-10-15 15:39:04 -070057# define NDNBOOST_MPL_AUX_VALUE_WKND(C) C
58# define NDNBOOST_MPL_AUX_MSVC_VALUE_WKND(C) C
Jeff Thompsonf7d49942013-08-01 16:47:40 -070059
60#endif
61
Jeff Thompson3d613fd2013-10-15 15:39:04 -070062#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 Thompsonf7d49942013-08-01 16:47:40 -070065/**/
66#else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070067# define NDNBOOST_MPL_AUX_NESTED_VALUE_WKND(T, C) \
68 NDNBOOST_MPL_AUX_VALUE_WKND(C)::value \
Jeff Thompsonf7d49942013-08-01 16:47:40 -070069/**/
70#endif
71
72
73namespace ndnboost { namespace mpl { namespace aux {
74
75template< typename T > struct value_type_wknd
76{
77 typedef typename T::value_type type;
78};
79
Jeff Thompson3d613fd2013-10-15 15:39:04 -070080#if defined(NDNBOOST_MPL_CFG_MSVC_ETI_BUG)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070081template<> struct value_type_wknd<int>
82{
83 typedef int type;
84};
85#endif
86
87}}}
88
Jeff Thompson3d613fd2013-10-15 15:39:04 -070089#endif // NDNBOOST_MPL_AUX_VALUE_WKND_HPP_INCLUDED