Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 1 | |
| 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 Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 9 | #ifndef NDNBOOST_TT_IS_INTEGRAL_HPP_INCLUDED |
| 10 | #define NDNBOOST_TT_IS_INTEGRAL_HPP_INCLUDED |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 11 | |
Jeff Thompson | 2277ce5 | 2013-08-01 17:34:11 -0700 | [diff] [blame] | 12 | #include <ndnboost/config.hpp> |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 13 | |
| 14 | // should be the last #include |
Jeff Thompson | 2277ce5 | 2013-08-01 17:34:11 -0700 | [diff] [blame] | 15 | #include <ndnboost/type_traits/detail/bool_trait_def.hpp> |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 16 | |
| 17 | namespace 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 Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 23 | NDNBOOST_TT_AUX_BOOL_TRAIT_DEF1(is_integral,T,__is_integral(T)) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 24 | #else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 25 | NDNBOOST_TT_AUX_BOOL_TRAIT_DEF1(is_integral,T,false) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 26 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 27 | NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned char,true) |
| 28 | NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned short,true) |
| 29 | NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned int,true) |
| 30 | NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned long,true) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 31 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 32 | NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,signed char,true) |
| 33 | NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,signed short,true) |
| 34 | NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,signed int,true) |
| 35 | NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,signed long,true) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 36 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 37 | NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,bool,true) |
| 38 | NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,char,true) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 39 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 40 | #ifndef NDNBOOST_NO_INTRINSIC_WCHAR_T |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 41 | // 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 Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 43 | // and define NDNBOOST_NO_INTRINSIC_WCHAR_T on the command line. |
| 44 | NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,wchar_t,true) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 45 | #endif |
| 46 | |
Jeff Thompson | 9939dcd | 2013-10-15 15:12:24 -0700 | [diff] [blame] | 47 | // Same set of integral types as in ndnboost/type_traits/integral_promotion.hpp. |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 48 | // Please, keep in sync. -- Alexander Nasonov |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 49 | #if (defined(NDNBOOST_MSVC) && (NDNBOOST_MSVC < 1300)) \ |
| 50 | || (defined(NDNBOOST_INTEL_CXX_VERSION) && defined(_MSC_VER) && (NDNBOOST_INTEL_CXX_VERSION <= 600)) \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 51 | || (defined(__BORLANDC__) && (__BORLANDC__ == 0x600) && (_MSC_VER < 1300)) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 52 | NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int8,true) |
| 53 | NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int8,true) |
| 54 | NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int16,true) |
| 55 | NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int16,true) |
| 56 | NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int32,true) |
| 57 | NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int32,true) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 58 | #ifdef __BORLANDC__ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 59 | NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int64,true) |
| 60 | NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int64,true) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 61 | #endif |
| 62 | #endif |
| 63 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 64 | # if defined(NDNBOOST_HAS_LONG_LONG) |
| 65 | NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral, ::ndnboost::ulong_long_type,true) |
| 66 | NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral, ::ndnboost::long_long_type,true) |
| 67 | #elif defined(NDNBOOST_HAS_MS_INT64) |
| 68 | NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int64,true) |
| 69 | NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int64,true) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 70 | #endif |
| 71 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 72 | #ifdef NDNBOOST_HAS_INT128 |
| 73 | NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,ndnboost::int128_type,true) |
| 74 | NDNBOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,ndnboost::uint128_type,true) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 75 | #endif |
| 76 | |
| 77 | #endif // non-CodeGear implementation |
| 78 | |
| 79 | } // namespace ndnboost |
| 80 | |
Jeff Thompson | 2277ce5 | 2013-08-01 17:34:11 -0700 | [diff] [blame] | 81 | #include <ndnboost/type_traits/detail/bool_trait_undef.hpp> |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 82 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 83 | #endif // NDNBOOST_TT_IS_INTEGRAL_HPP_INCLUDED |