summaryrefslogtreecommitdiff
path: root/boost/integer.hpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2016-03-21 15:45:20 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2016-03-21 15:46:37 +0900
commit733b5d5ae2c5d625211e2985ac25728ac3f54883 (patch)
treea5b214744b256f07e1dc2bd7273035a7808c659f /boost/integer.hpp
parent08c1e93fa36a49f49325a07fe91ff92c964c2b6c (diff)
downloadboost-733b5d5ae2c5d625211e2985ac25728ac3f54883.tar.gz
boost-733b5d5ae2c5d625211e2985ac25728ac3f54883.tar.bz2
boost-733b5d5ae2c5d625211e2985ac25728ac3f54883.zip
Imported Upstream version 1.58.0upstream/1.58.0
Change-Id: If0072143aa26874812e0db6872e1efb10a3e5e94 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/integer.hpp')
-rw-r--r--boost/integer.hpp49
1 files changed, 25 insertions, 24 deletions
diff --git a/boost/integer.hpp b/boost/integer.hpp
index 35a1e10988..9fa0019484 100644
--- a/boost/integer.hpp
+++ b/boost/integer.hpp
@@ -42,15 +42,15 @@ namespace boost
// fast integers from least integers
// int_fast_t<> works correctly for unsigned too, in spite of the name.
template< typename LeastInt >
- struct int_fast_t
- {
- typedef LeastInt fast;
+ struct int_fast_t
+ {
+ typedef LeastInt fast;
typedef fast type;
}; // imps may specialize
namespace detail{
- // convert category to type
+ // convert category to type
template< int Category > struct int_least_helper {}; // default is empty
template< int Category > struct uint_least_helper {}; // default is empty
@@ -91,7 +91,8 @@ namespace boost
template <> struct exact_signed_base_helper<sizeof(int)* CHAR_BIT> { typedef int exact; };
template <> struct exact_unsigned_base_helper<sizeof(unsigned int)* CHAR_BIT> { typedef unsigned int exact; };
#endif
-#if ULONG_MAX != UINT_MAX
+#if ULONG_MAX != UINT_MAX && ( !defined __TI_COMPILER_VERSION__ || \
+ ( __TI_COMPILER_VERSION__ >= 7000000 && !defined __TI_40BIT_LONG__ ) )
template <> struct exact_signed_base_helper<sizeof(long)* CHAR_BIT> { typedef long exact; };
template <> struct exact_unsigned_base_helper<sizeof(unsigned long)* CHAR_BIT> { typedef unsigned long exact; };
#endif
@@ -111,11 +112,11 @@ namespace boost
// signed
template< int Bits > // bits (including sign) required
- struct int_t : public detail::exact_signed_base_helper<Bits>
+ struct int_t : public boost::detail::exact_signed_base_helper<Bits>
{
BOOST_STATIC_ASSERT_MSG(Bits <= (int)(sizeof(boost::intmax_t) * CHAR_BIT),
"No suitable signed integer type with the requested number of bits is available.");
- typedef typename detail::int_least_helper
+ typedef typename boost::detail::int_least_helper
<
#ifdef BOOST_HAS_LONG_LONG
(Bits <= (int)(sizeof(boost::long_long_type) * CHAR_BIT)) +
@@ -132,13 +133,13 @@ namespace boost
// unsigned
template< int Bits > // bits required
- struct uint_t : public detail::exact_unsigned_base_helper<Bits>
+ struct uint_t : public boost::detail::exact_unsigned_base_helper<Bits>
{
BOOST_STATIC_ASSERT_MSG(Bits <= (int)(sizeof(boost::uintmax_t) * CHAR_BIT),
"No suitable unsigned integer type with the requested number of bits is available.");
#if (defined(__BORLANDC__) || defined(__CODEGEAR__)) && defined(BOOST_NO_INTEGRAL_INT64_T)
// It's really not clear why this workaround should be needed... shrug I guess! JM
- BOOST_STATIC_CONSTANT(int, s =
+ BOOST_STATIC_CONSTANT(int, s =
6 +
(Bits <= ::std::numeric_limits<unsigned long>::digits) +
(Bits <= ::std::numeric_limits<unsigned int>::digits) +
@@ -146,8 +147,8 @@ namespace boost
(Bits <= ::std::numeric_limits<unsigned char>::digits));
typedef typename detail::int_least_helper< ::boost::uint_t<Bits>::s>::least least;
#else
- typedef typename detail::uint_least_helper
- <
+ typedef typename boost::detail::uint_least_helper
+ <
#ifdef BOOST_HAS_LONG_LONG
(Bits <= (int)(sizeof(boost::long_long_type) * CHAR_BIT)) +
#else
@@ -166,16 +167,16 @@ namespace boost
// integer templates specifying extreme value ----------------------------//
// signed
-#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG)
+#if !defined(BOOST_NO_INTEGRAL_INT64_T) && !defined(BOOST_NO_INT64_T) && defined(BOOST_HAS_LONG_LONG)
template< boost::long_long_type MaxValue > // maximum value to require support
#else
template< long MaxValue > // maximum value to require support
#endif
- struct int_max_value_t
+ struct int_max_value_t
{
- typedef typename detail::int_least_helper
+ typedef typename boost::detail::int_least_helper
<
-#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG)
+#if !defined(BOOST_NO_INTEGRAL_INT64_T) && !defined(BOOST_NO_INT64_T) && defined(BOOST_HAS_LONG_LONG)
(MaxValue <= ::boost::integer_traits<boost::long_long_type>::const_max) +
#else
1 +
@@ -188,16 +189,16 @@ namespace boost
typedef typename int_fast_t<least>::type fast;
};
-#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG)
+#if !defined(BOOST_NO_INTEGRAL_INT64_T) && !defined(BOOST_NO_INT64_T) && defined(BOOST_HAS_LONG_LONG)
template< boost::long_long_type MinValue > // minimum value to require support
#else
template< long MinValue > // minimum value to require support
#endif
- struct int_min_value_t
+ struct int_min_value_t
{
- typedef typename detail::int_least_helper
+ typedef typename boost::detail::int_least_helper
<
-#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG)
+#if !defined(BOOST_NO_INTEGRAL_INT64_T) && !defined(BOOST_NO_INT64_T) && defined(BOOST_HAS_LONG_LONG)
(MinValue >= ::boost::integer_traits<boost::long_long_type>::const_min) +
#else
1 +
@@ -216,12 +217,12 @@ namespace boost
#else
template< unsigned long MaxValue > // minimum value to require support
#endif
- struct uint_value_t
+ struct uint_value_t
{
#if (defined(__BORLANDC__) || defined(__CODEGEAR__))
// It's really not clear why this workaround should be needed... shrug I guess! JM
#if defined(BOOST_NO_INTEGRAL_INT64_T)
- BOOST_STATIC_CONSTANT(unsigned, which =
+ BOOST_STATIC_CONSTANT(unsigned, which =
1 +
(MaxValue <= ::boost::integer_traits<unsigned long>::const_max) +
(MaxValue <= ::boost::integer_traits<unsigned int>::const_max) +
@@ -229,7 +230,7 @@ namespace boost
(MaxValue <= ::boost::integer_traits<unsigned char>::const_max));
typedef typename detail::int_least_helper< ::boost::uint_value_t<MaxValue>::which>::least least;
#else // BOOST_NO_INTEGRAL_INT64_T
- BOOST_STATIC_CONSTANT(unsigned, which =
+ BOOST_STATIC_CONSTANT(unsigned, which =
1 +
(MaxValue <= ::boost::integer_traits<boost::ulong_long_type>::const_max) +
(MaxValue <= ::boost::integer_traits<unsigned long>::const_max) +
@@ -239,8 +240,8 @@ namespace boost
typedef typename detail::uint_least_helper< ::boost::uint_value_t<MaxValue>::which>::least least;
#endif // BOOST_NO_INTEGRAL_INT64_T
#else
- typedef typename detail::uint_least_helper
- <
+ typedef typename boost::detail::uint_least_helper
+ <
#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG)
(MaxValue <= ::boost::integer_traits<boost::ulong_long_type>::const_max) +
#else