diff --git a/include/boost/type_traits/is_integral.hpp b/include/boost/type_traits/is_integral.hpp index 99420a9..b5089ec 100644 --- a/include/boost/type_traits/is_integral.hpp +++ b/include/boost/type_traits/is_integral.hpp @@ -68,6 +68,11 @@ BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral, ::boost::long_long_type,true) BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int64,true) BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int64,true) #endif + +#ifdef BOOST_HAS_INT128 +BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,boost::int128_type,true) +BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,boost::uint128_type,true) +#endif #endif // non-CodeGear implementation diff --git a/include/boost/type_traits/make_signed.hpp b/include/boost/type_traits/make_signed.hpp index 51cfd95..7deb855 100644 --- a/include/boost/type_traits/make_signed.hpp +++ b/include/boost/type_traits/make_signed.hpp @@ -72,7 +72,15 @@ struct make_signed_imp is_same, long, #if defined(BOOST_HAS_LONG_LONG) +#ifdef BOOST_HAS_INT128 + typename mpl::if_c< + sizeof(t_no_cv) == sizeof(boost::long_long_type), + boost::long_long_type, + boost::int128_type + >::type +#else boost::long_long_type +#endif #elif defined(BOOST_HAS_MS_INT64) __int64 #else @@ -96,7 +104,15 @@ struct make_signed_imp sizeof(t_no_cv) == sizeof(unsigned long), long, #if defined(BOOST_HAS_LONG_LONG) +#ifdef BOOST_HAS_INT128 + typename mpl::if_c< + sizeof(t_no_cv) == sizeof(boost::long_long_type), + boost::long_long_type, + boost::int128_type + >::type +#else boost::long_long_type +#endif #elif defined(BOOST_HAS_MS_INT64) __int64 #else diff --git a/include/boost/type_traits/make_unsigned.hpp b/include/boost/type_traits/make_unsigned.hpp index 54f9f66..7e2fcdc 100644 --- a/include/boost/type_traits/make_unsigned.hpp +++ b/include/boost/type_traits/make_unsigned.hpp @@ -72,7 +72,15 @@ struct make_unsigned_imp is_same, unsigned long, #if defined(BOOST_HAS_LONG_LONG) +#ifdef BOOST_HAS_INT128 + typename mpl::if_c< + sizeof(t_no_cv) == sizeof(boost::ulong_long_type), + boost::ulong_long_type, + boost::uint128_type + >::type +#else boost::ulong_long_type +#endif #elif defined(BOOST_HAS_MS_INT64) unsigned __int64 #else @@ -96,7 +104,15 @@ struct make_unsigned_imp sizeof(t_no_cv) == sizeof(unsigned long), unsigned long, #if defined(BOOST_HAS_LONG_LONG) +#ifdef BOOST_HAS_INT128 + typename mpl::if_c< + sizeof(t_no_cv) == sizeof(boost::ulong_long_type), + boost::ulong_long_type, + boost::uint128_type + >::type +#else boost::ulong_long_type +#endif #elif defined(BOOST_HAS_MS_INT64) unsigned __int64 #else diff --git a/test/is_integral_test.cpp b/test/is_integral_test.cpp index 445e941..7b28824 100644 --- a/test/is_integral_test.cpp +++ b/test/is_integral_test.cpp @@ -112,6 +112,18 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int64 const volatile>::value, #endif +#ifdef BOOST_HAS_INT128 + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); + +#endif // // cases that should not be true: // diff --git a/test/is_signed_test.cpp b/test/is_signed_test.cpp index 7e1a9a1..28bc070 100644 --- a/test/is_signed_test.cpp +++ b/test/is_signed_test.cpp @@ -31,6 +31,10 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed::value, false); +#ifdef BOOST_HAS_INT128 +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed::value, false); +#endif TT_TEST_END diff --git a/test/is_unsigned_test.cpp b/test/is_unsigned_test.cpp index 68c2574..68b0890 100644 --- a/test/is_unsigned_test.cpp +++ b/test/is_unsigned_test.cpp @@ -31,6 +31,11 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned::value, false); +#ifdef BOOST_HAS_INT128 +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned::value, true); +#endif + TT_TEST_END diff --git a/test/make_signed_test.cpp b/test/make_signed_test.cpp index af08bd5..cb9da2d 100644 --- a/test/make_signed_test.cpp +++ b/test/make_signed_test.cpp @@ -95,6 +95,10 @@ BOOST_CHECK_TYPE(::tt::make_signed::type, #elif defined(BOOST_HAS_MS_INT64) BOOST_CHECK_TYPE(::tt::make_signed::type, const volatile __int64); #endif +#ifdef BOOST_HAS_INT128 +BOOST_CHECK_TYPE(::tt::make_signed::type, boost::int128_type); +BOOST_CHECK_TYPE(::tt::make_signed::type, boost::int128_type); +#endif // character types: BOOST_CHECK_TYPE(::tt::make_signed::type, signed char); diff --git a/test/make_unsigned_test.cpp b/test/make_unsigned_test.cpp index 2ffe1b9..117a8e6 100644 --- a/test/make_unsigned_test.cpp +++ b/test/make_unsigned_test.cpp @@ -95,6 +95,10 @@ BOOST_CHECK_TYPE(::tt::make_unsigned::typ #elif defined(BOOST_HAS_MS_INT64) BOOST_CHECK_TYPE(::tt::make_unsigned::type, const volatile unsigned __int64); #endif +#ifdef BOOST_HAS_INT128 +BOOST_CHECK_TYPE(::tt::make_unsigned::type, boost::uint128_type); +BOOST_CHECK_TYPE(::tt::make_unsigned::type, boost::uint128_type); +#endif // character types: BOOST_CHECK_TYPE(::tt::make_unsigned::type, unsigned char);