forked from boostorg/integer
manage with #6694 Boost.Integer part.
This commit is contained in:
@ -42,15 +42,15 @@ namespace boost
|
|||||||
// fast integers from least integers
|
// fast integers from least integers
|
||||||
// int_fast_t<> works correctly for unsigned too, in spite of the name.
|
// int_fast_t<> works correctly for unsigned too, in spite of the name.
|
||||||
template< typename LeastInt >
|
template< typename LeastInt >
|
||||||
struct int_fast_t
|
struct int_fast_t
|
||||||
{
|
{
|
||||||
typedef LeastInt fast;
|
typedef LeastInt fast;
|
||||||
typedef fast type;
|
typedef fast type;
|
||||||
}; // imps may specialize
|
}; // imps may specialize
|
||||||
|
|
||||||
namespace detail{
|
namespace detail{
|
||||||
|
|
||||||
// convert category to type
|
// convert category to type
|
||||||
template< int Category > struct int_least_helper {}; // default is empty
|
template< int Category > struct int_least_helper {}; // default is empty
|
||||||
template< int Category > struct uint_least_helper {}; // default is empty
|
template< int Category > struct uint_least_helper {}; // default is empty
|
||||||
|
|
||||||
@ -138,7 +138,7 @@ namespace boost
|
|||||||
"No suitable unsigned integer type with the requested number of bits is available.");
|
"No suitable unsigned integer type with the requested number of bits is available.");
|
||||||
#if (defined(__BORLANDC__) || defined(__CODEGEAR__)) && defined(BOOST_NO_INTEGRAL_INT64_T)
|
#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
|
// 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 +
|
6 +
|
||||||
(Bits <= ::std::numeric_limits<unsigned long>::digits) +
|
(Bits <= ::std::numeric_limits<unsigned long>::digits) +
|
||||||
(Bits <= ::std::numeric_limits<unsigned int>::digits) +
|
(Bits <= ::std::numeric_limits<unsigned int>::digits) +
|
||||||
@ -147,7 +147,7 @@ namespace boost
|
|||||||
typedef typename detail::int_least_helper< ::boost::uint_t<Bits>::s>::least least;
|
typedef typename detail::int_least_helper< ::boost::uint_t<Bits>::s>::least least;
|
||||||
#else
|
#else
|
||||||
typedef typename boost::detail::uint_least_helper
|
typedef typename boost::detail::uint_least_helper
|
||||||
<
|
<
|
||||||
#ifdef BOOST_HAS_LONG_LONG
|
#ifdef BOOST_HAS_LONG_LONG
|
||||||
(Bits <= (int)(sizeof(boost::long_long_type) * CHAR_BIT)) +
|
(Bits <= (int)(sizeof(boost::long_long_type) * CHAR_BIT)) +
|
||||||
#else
|
#else
|
||||||
@ -166,16 +166,16 @@ namespace boost
|
|||||||
// integer templates specifying extreme value ----------------------------//
|
// integer templates specifying extreme value ----------------------------//
|
||||||
|
|
||||||
// signed
|
// 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
|
template< boost::long_long_type MaxValue > // maximum value to require support
|
||||||
#else
|
#else
|
||||||
template< long MaxValue > // maximum value to require support
|
template< long MaxValue > // maximum value to require support
|
||||||
#endif
|
#endif
|
||||||
struct int_max_value_t
|
struct int_max_value_t
|
||||||
{
|
{
|
||||||
typedef typename boost::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) +
|
(MaxValue <= ::boost::integer_traits<boost::long_long_type>::const_max) +
|
||||||
#else
|
#else
|
||||||
1 +
|
1 +
|
||||||
@ -188,16 +188,16 @@ namespace boost
|
|||||||
typedef typename int_fast_t<least>::type fast;
|
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
|
template< boost::long_long_type MinValue > // minimum value to require support
|
||||||
#else
|
#else
|
||||||
template< long MinValue > // minimum value to require support
|
template< long MinValue > // minimum value to require support
|
||||||
#endif
|
#endif
|
||||||
struct int_min_value_t
|
struct int_min_value_t
|
||||||
{
|
{
|
||||||
typedef typename boost::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) +
|
(MinValue >= ::boost::integer_traits<boost::long_long_type>::const_min) +
|
||||||
#else
|
#else
|
||||||
1 +
|
1 +
|
||||||
@ -216,12 +216,12 @@ namespace boost
|
|||||||
#else
|
#else
|
||||||
template< unsigned long MaxValue > // minimum value to require support
|
template< unsigned long MaxValue > // minimum value to require support
|
||||||
#endif
|
#endif
|
||||||
struct uint_value_t
|
struct uint_value_t
|
||||||
{
|
{
|
||||||
#if (defined(__BORLANDC__) || defined(__CODEGEAR__))
|
#if (defined(__BORLANDC__) || defined(__CODEGEAR__))
|
||||||
// It's really not clear why this workaround should be needed... shrug I guess! JM
|
// It's really not clear why this workaround should be needed... shrug I guess! JM
|
||||||
#if defined(BOOST_NO_INTEGRAL_INT64_T)
|
#if defined(BOOST_NO_INTEGRAL_INT64_T)
|
||||||
BOOST_STATIC_CONSTANT(unsigned, which =
|
BOOST_STATIC_CONSTANT(unsigned, which =
|
||||||
1 +
|
1 +
|
||||||
(MaxValue <= ::boost::integer_traits<unsigned long>::const_max) +
|
(MaxValue <= ::boost::integer_traits<unsigned long>::const_max) +
|
||||||
(MaxValue <= ::boost::integer_traits<unsigned int>::const_max) +
|
(MaxValue <= ::boost::integer_traits<unsigned int>::const_max) +
|
||||||
@ -229,7 +229,7 @@ namespace boost
|
|||||||
(MaxValue <= ::boost::integer_traits<unsigned char>::const_max));
|
(MaxValue <= ::boost::integer_traits<unsigned char>::const_max));
|
||||||
typedef typename detail::int_least_helper< ::boost::uint_value_t<MaxValue>::which>::least least;
|
typedef typename detail::int_least_helper< ::boost::uint_value_t<MaxValue>::which>::least least;
|
||||||
#else // BOOST_NO_INTEGRAL_INT64_T
|
#else // BOOST_NO_INTEGRAL_INT64_T
|
||||||
BOOST_STATIC_CONSTANT(unsigned, which =
|
BOOST_STATIC_CONSTANT(unsigned, which =
|
||||||
1 +
|
1 +
|
||||||
(MaxValue <= ::boost::integer_traits<boost::ulong_long_type>::const_max) +
|
(MaxValue <= ::boost::integer_traits<boost::ulong_long_type>::const_max) +
|
||||||
(MaxValue <= ::boost::integer_traits<unsigned long>::const_max) +
|
(MaxValue <= ::boost::integer_traits<unsigned long>::const_max) +
|
||||||
@ -240,7 +240,7 @@ namespace boost
|
|||||||
#endif // BOOST_NO_INTEGRAL_INT64_T
|
#endif // BOOST_NO_INTEGRAL_INT64_T
|
||||||
#else
|
#else
|
||||||
typedef typename boost::detail::uint_least_helper
|
typedef typename boost::detail::uint_least_helper
|
||||||
<
|
<
|
||||||
#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG)
|
#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG)
|
||||||
(MaxValue <= ::boost::integer_traits<boost::ulong_long_type>::const_max) +
|
(MaxValue <= ::boost::integer_traits<boost::ulong_long_type>::const_max) +
|
||||||
#else
|
#else
|
||||||
|
Reference in New Issue
Block a user