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 | |
9 | #ifndef BOOST_TT_IS_INTEGRAL_HPP_INCLUDED |
10 | #define BOOST_TT_IS_INTEGRAL_HPP_INCLUDED |
11 | |
12 | #include <boost/config.hpp> |
13 | |
14 | // should be the last #include |
15 | #include <boost/type_traits/detail/bool_trait_def.hpp> |
16 | |
17 | namespace boost { |
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__ ) |
23 | BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_integral,T,__is_integral(T)) |
24 | #else |
25 | BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_integral,T,false) |
26 | |
27 | BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned char,true) |
28 | BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned short,true) |
29 | BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned int,true) |
30 | BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned long,true) |
31 | |
32 | BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,signed char,true) |
33 | BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,signed short,true) |
34 | BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,signed int,true) |
35 | BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,signed long,true) |
36 | |
37 | BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,bool,true) |
38 | BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,char,true) |
39 | |
40 | #ifndef BOOST_NO_INTRINSIC_WCHAR_T |
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, |
43 | // and define BOOST_NO_INTRINSIC_WCHAR_T on the command line. |
44 | BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,wchar_t,true) |
45 | #endif |
46 | |
47 | // Same set of integral types as in boost/type_traits/integral_promotion.hpp. |
48 | // Please, keep in sync. -- Alexander Nasonov |
49 | #if (defined(BOOST_INTEL_CXX_VERSION) && defined(_MSC_VER) && (BOOST_INTEL_CXX_VERSION <= 600)) \ |
50 | || (defined(__BORLANDC__) && (__BORLANDC__ == 0x600) && (_MSC_VER < 1300)) |
51 | BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int8,true) |
52 | BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int8,true) |
53 | BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int16,true) |
54 | BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int16,true) |
55 | BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int32,true) |
56 | BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int32,true) |
57 | #ifdef __BORLANDC__ |
58 | BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int64,true) |
59 | BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int64,true) |
60 | #endif |
61 | #endif |
62 | |
63 | # if defined(BOOST_HAS_LONG_LONG) |
64 | BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral, ::boost::ulong_long_type,true) |
65 | BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral, ::boost::long_long_type,true) |
66 | #elif defined(BOOST_HAS_MS_INT64) |
67 | BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int64,true) |
68 | BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int64,true) |
69 | #endif |
70 | |
71 | #ifdef BOOST_HAS_INT128 |
72 | BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,boost::int128_type,true) |
73 | BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,boost::uint128_type,true) |
74 | #endif |
75 | #ifndef BOOST_NO_CXX11_CHAR16_T |
76 | BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,char16_t,true) |
77 | #endif |
78 | #ifndef BOOST_NO_CXX11_CHAR32_T |
79 | BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,char32_t,true) |
80 | #endif |
81 | |
82 | #endif // non-CodeGear implementation |
83 | |
84 | } // namespace boost |
85 | |
86 | #include <boost/type_traits/detail/bool_trait_undef.hpp> |
87 | |
88 | #endif // BOOST_TT_IS_INTEGRAL_HPP_INCLUDED |
89 | |