Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:53:11

0001 
0002 //  (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
0003 //  Use, modification and distribution are subject to the Boost Software License,
0004 //  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0005 //  http://www.boost.org/LICENSE_1_0.txt).
0006 //
0007 //  See http://www.boost.org/libs/type_traits for most recent version including documentation.
0008 
0009 #ifndef BOOST_TT_IS_INTEGRAL_HPP_INCLUDED
0010 #define BOOST_TT_IS_INTEGRAL_HPP_INCLUDED
0011 
0012 #include <boost/config.hpp>
0013 #include <boost/type_traits/integral_constant.hpp>
0014 
0015 namespace boost {
0016 
0017 #if defined( BOOST_CODEGEARC )
0018    template <class T>
0019    struct is_integral : public integral_constant<bool, __is_integral(T)> {};
0020 #else
0021 
0022 template <class T> struct is_integral : public false_type {};
0023 template <class T> struct is_integral<const T> : public is_integral<T> {};
0024 template <class T> struct is_integral<volatile const T> : public is_integral<T>{};
0025 template <class T> struct is_integral<volatile T> : public is_integral<T>{};
0026 
0027 //* is a type T an [cv-qualified-] integral type described in the standard (3.9.1p3)
0028 // as an extension we include long long, as this is likely to be added to the
0029 // standard at a later date
0030 template<> struct is_integral<unsigned char> : public true_type {};
0031 template<> struct is_integral<unsigned short> : public true_type{};
0032 template<> struct is_integral<unsigned int> : public true_type{};
0033 template<> struct is_integral<unsigned long> : public true_type{};
0034 
0035 template<> struct is_integral<signed char> : public true_type{};
0036 template<> struct is_integral<short> : public true_type{};
0037 template<> struct is_integral<int> : public true_type{};
0038 template<> struct is_integral<long> : public true_type{};
0039 
0040 template<> struct is_integral<char> : public true_type{};
0041 template<> struct is_integral<bool> : public true_type{};
0042 
0043 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
0044 // If the following line fails to compile and you're using the Intel
0045 // compiler, see http://lists.boost.org/MailArchives/boost-users/msg06567.php,
0046 // and define BOOST_NO_INTRINSIC_WCHAR_T on the command line.
0047 template<> struct is_integral<wchar_t> : public true_type{};
0048 #endif
0049 
0050 // Same set of integral types as in boost/type_traits/integral_promotion.hpp.
0051 // Please, keep in sync. -- Alexander Nasonov
0052 #if (defined(BOOST_INTEL_CXX_VERSION) && defined(_MSC_VER) && (BOOST_INTEL_CXX_VERSION <= 600)) \
0053     || (defined(BOOST_BORLANDC) && (BOOST_BORLANDC == 0x600) && (_MSC_VER < 1300))
0054 template<> struct is_integral<unsigned __int8> : public true_type{};
0055 template<> struct is_integral<unsigned __int16> : public true_type{};
0056 template<> struct is_integral<unsigned __int32> : public true_type{};
0057 template<> struct is_integral<__int8> : public true_type{};
0058 template<> struct is_integral<__int16> : public true_type{};
0059 template<> struct is_integral<__int32> : public true_type{};
0060 #ifdef BOOST_BORLANDC
0061 template<> struct is_integral<unsigned __int64> : public true_type{};
0062 template<> struct is_integral<__int64> : public true_type{};
0063 #endif
0064 #endif
0065 
0066 # if defined(BOOST_HAS_LONG_LONG)
0067 template<> struct is_integral< ::boost::ulong_long_type> : public true_type{};
0068 template<> struct is_integral< ::boost::long_long_type> : public true_type{};
0069 #elif defined(BOOST_HAS_MS_INT64)
0070 template<> struct is_integral<unsigned __int64> : public true_type{};
0071 template<> struct is_integral<__int64> : public true_type{};
0072 #endif
0073         
0074 #ifdef BOOST_HAS_INT128
0075 template<> struct is_integral<boost::int128_type> : public true_type{};
0076 template<> struct is_integral<boost::uint128_type> : public true_type{};
0077 #endif
0078 #ifndef BOOST_NO_CXX11_CHAR16_T
0079 template<> struct is_integral<char16_t> : public true_type{};
0080 #endif
0081 #ifndef BOOST_NO_CXX11_CHAR32_T
0082 template<> struct is_integral<char32_t> : public true_type{};
0083 #endif
0084 #if defined(__cpp_char8_t) && __cpp_char8_t >= 201811L
0085 template<> struct is_integral<char8_t> : public true_type{};
0086 #endif
0087 
0088 #endif  // non-CodeGear implementation
0089 
0090 } // namespace boost
0091 
0092 #endif // BOOST_TT_IS_INTEGRAL_HPP_INCLUDED