blob: 1e44256429ad66086d008cfdb76aaa218edd1d0f [file] [log] [blame]
Jeff Thompsonf7d49942013-08-01 16:47:40 -07001
2// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
3// Use, modification and distribution are subject to the Boost Software License,
4// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5// http://www.boost.org/LICENSE_1_0.txt).
6//
7// See http://www.boost.org/libs/type_traits for most recent version including documentation.
8
Jeff Thompson3d613fd2013-10-15 15:39:04 -07009#ifndef NDNBOOST_TT_IS_INTEGRAL_HPP_INCLUDED
10#define NDNBOOST_TT_IS_INTEGRAL_HPP_INCLUDED
Jeff Thompsonf7d49942013-08-01 16:47:40 -070011
Jeff Thompson2277ce52013-08-01 17:34:11 -070012#include <ndnboost/config.hpp>
Jeff Thompsonf7d49942013-08-01 16:47:40 -070013
14// should be the last #include
Jeff Thompson2277ce52013-08-01 17:34:11 -070015#include <ndnboost/type_traits/detail/bool_trait_def.hpp>
Jeff Thompsonf7d49942013-08-01 16:47:40 -070016
17namespace ndnboost {
18
19//* is a type T an [cv-qualified-] integral type described in the standard (3.9.1p3)
20// as an extension we include long long, as this is likely to be added to the
21// standard at a later date
22#if defined( __CODEGEARC__ )
Jeff Thompson3d613fd2013-10-15 15:39:04 -070023NDNBOOST_TT_AUX_BOOL_TRAIT_DEF1(is_integral,T,__is_integral(T))
Jeff Thompsonf7d49942013-08-01 16:47:40 -070024#else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070025NDNBOOST_TT_AUX_BOOL_TRAIT_DEF1(is_integral,T,false)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070026
Jeff Thompson3d613fd2013-10-15 15:39:04 -070027NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned char,true)
28NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned short,true)
29NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned int,true)
30NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned long,true)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070031
Jeff Thompson3d613fd2013-10-15 15:39:04 -070032NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,signed char,true)
33NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,signed short,true)
34NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,signed int,true)
35NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,signed long,true)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070036
Jeff Thompson3d613fd2013-10-15 15:39:04 -070037NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,bool,true)
38NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,char,true)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070039
Jeff Thompson3d613fd2013-10-15 15:39:04 -070040#ifndef NDNBOOST_NO_INTRINSIC_WCHAR_T
Jeff Thompsonf7d49942013-08-01 16:47:40 -070041// If the following line fails to compile and you're using the Intel
42// compiler, see http://lists.boost.org/MailArchives/boost-users/msg06567.php,
Jeff Thompson3d613fd2013-10-15 15:39:04 -070043// and define NDNBOOST_NO_INTRINSIC_WCHAR_T on the command line.
44NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,wchar_t,true)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070045#endif
46
Jeff Thompson9939dcd2013-10-15 15:12:24 -070047// Same set of integral types as in ndnboost/type_traits/integral_promotion.hpp.
Jeff Thompsonf7d49942013-08-01 16:47:40 -070048// Please, keep in sync. -- Alexander Nasonov
Jeff Thompson3d613fd2013-10-15 15:39:04 -070049#if (defined(NDNBOOST_MSVC) && (NDNBOOST_MSVC < 1300)) \
50 || (defined(NDNBOOST_INTEL_CXX_VERSION) && defined(_MSC_VER) && (NDNBOOST_INTEL_CXX_VERSION <= 600)) \
Jeff Thompsonf7d49942013-08-01 16:47:40 -070051 || (defined(__BORLANDC__) && (__BORLANDC__ == 0x600) && (_MSC_VER < 1300))
Jeff Thompson3d613fd2013-10-15 15:39:04 -070052NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int8,true)
53NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int8,true)
54NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int16,true)
55NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int16,true)
56NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int32,true)
57NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int32,true)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070058#ifdef __BORLANDC__
Jeff Thompson3d613fd2013-10-15 15:39:04 -070059NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int64,true)
60NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int64,true)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070061#endif
62#endif
63
Jeff Thompson3d613fd2013-10-15 15:39:04 -070064# if defined(NDNBOOST_HAS_LONG_LONG)
65NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral, ::ndnboost::ulong_long_type,true)
66NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral, ::ndnboost::long_long_type,true)
67#elif defined(NDNBOOST_HAS_MS_INT64)
68NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int64,true)
69NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int64,true)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070070#endif
71
Jeff Thompson3d613fd2013-10-15 15:39:04 -070072#ifdef NDNBOOST_HAS_INT128
73NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,ndnboost::int128_type,true)
74NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,ndnboost::uint128_type,true)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070075#endif
76
77#endif // non-CodeGear implementation
78
79} // namespace ndnboost
80
Jeff Thompson2277ce52013-08-01 17:34:11 -070081#include <ndnboost/type_traits/detail/bool_trait_undef.hpp>
Jeff Thompsonf7d49942013-08-01 16:47:40 -070082
Jeff Thompson3d613fd2013-10-15 15:39:04 -070083#endif // NDNBOOST_TT_IS_INTEGRAL_HPP_INCLUDED