forked from boostorg/integer
Added extended-integer support
[SVN r47842]
This commit is contained in:
@ -15,6 +15,8 @@
|
||||
#include <boost/config.hpp> // for BOOST_STATIC_CONSTANT
|
||||
#include <boost/integer.hpp> // for boost::uint_t
|
||||
|
||||
#include <boost/detail/extended_integer.hpp> // for BOOST_HAS_XINT, etc.
|
||||
|
||||
#include <climits> // for UCHAR_MAX, etc.
|
||||
#include <cstddef> // for std::size_t
|
||||
|
||||
@ -84,6 +86,10 @@ BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned int );
|
||||
BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned long );
|
||||
#endif
|
||||
|
||||
#if BOOST_HAS_XINT && (BOOST_UXINT_MAX > ULONG_MAX)
|
||||
BOOST_LOW_BITS_MASK_SPECIALIZE( ::boost::detail::uxint_t );
|
||||
#endif
|
||||
|
||||
#undef BOOST_LOW_BITS_MASK_SPECIALIZE
|
||||
|
||||
|
||||
|
@ -155,6 +155,12 @@ template < >
|
||||
struct low_bits_mask_t< ::std::numeric_limits<unsigned long>::digits >;
|
||||
#endif
|
||||
|
||||
#if BOOST_HAS_XINT && (BOOST_UXINT_MAX > ULONG_MAX)
|
||||
template < >
|
||||
struct low_bits_mask_t< ::std::numeric_limits< ::boost::detail::uxint_t
|
||||
>::digits >;
|
||||
#endif
|
||||
|
||||
|
||||
// From <boost/integer/static_log2.hpp> ------------------------------------//
|
||||
|
||||
|
@ -8,7 +8,8 @@
|
||||
// See http://www.boost.org for most recent version including documentation.
|
||||
|
||||
// Revision History
|
||||
// 27 Jul 2008 Changed tests to use the unit-test system (Daryle Walker)
|
||||
// 27 Jul 2008 Changed tests to use the unit-test system; added
|
||||
// extended-integer support. (Daryle Walker)
|
||||
// 23 Sep 2001 Initial version (Daryle Walker)
|
||||
|
||||
#define BOOST_TEST_MODULE "Integer mask tests"
|
||||
@ -16,6 +17,7 @@
|
||||
|
||||
#include <boost/cstdint.hpp> // for boost::uintmax_t
|
||||
#include <boost/integer/integer_mask.hpp> // for boost::high_bit_mask_t, etc.
|
||||
#include <boost/limits.hpp> // for std::numeric_limits
|
||||
#include <boost/mpl/assert.hpp> // for BOOST_MPL_ASSERT_RELATION
|
||||
#include <boost/mpl/range_c.hpp> // for boost::mpl::range_c
|
||||
|
||||
@ -30,8 +32,10 @@ namespace
|
||||
boost::uintmax_t const one = 1u;
|
||||
|
||||
// List the ranges of template parameters tests (ranges are half-open)
|
||||
typedef boost::mpl::range_c<std::size_t, 0u, 32u> high_bit_offsets;
|
||||
typedef boost::mpl::range_c<std::size_t, 1u, 33u> low_bit_lengths;
|
||||
int const max_offset = std::numeric_limits<boost::uintmax_t>::digits;
|
||||
|
||||
typedef boost::mpl::range_c<std::size_t, 0, max_offset> high_bit_offsets;
|
||||
typedef boost::mpl::range_c<std::size_t, 1, max_offset + 1> low_bit_lengths;
|
||||
|
||||
} // unnamed namespace
|
||||
|
||||
|
Reference in New Issue
Block a user