Added extended-integer support

[SVN r47842]
This commit is contained in:
Daryle Walker
2008-07-27 17:08:51 +00:00
parent 188cef05a9
commit f041dc0f0a
3 changed files with 19 additions and 3 deletions

View File

@ -15,6 +15,8 @@
#include <boost/config.hpp> // for BOOST_STATIC_CONSTANT #include <boost/config.hpp> // for BOOST_STATIC_CONSTANT
#include <boost/integer.hpp> // for boost::uint_t #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 <climits> // for UCHAR_MAX, etc.
#include <cstddef> // for std::size_t #include <cstddef> // for std::size_t
@ -84,6 +86,10 @@ BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned int );
BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned long ); BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned long );
#endif #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 #undef BOOST_LOW_BITS_MASK_SPECIALIZE

View File

@ -155,6 +155,12 @@ template < >
struct low_bits_mask_t< ::std::numeric_limits<unsigned long>::digits >; struct low_bits_mask_t< ::std::numeric_limits<unsigned long>::digits >;
#endif #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> ------------------------------------// // From <boost/integer/static_log2.hpp> ------------------------------------//

View File

@ -8,7 +8,8 @@
// See http://www.boost.org for most recent version including documentation. // See http://www.boost.org for most recent version including documentation.
// Revision History // 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) // 23 Sep 2001 Initial version (Daryle Walker)
#define BOOST_TEST_MODULE "Integer mask tests" #define BOOST_TEST_MODULE "Integer mask tests"
@ -16,6 +17,7 @@
#include <boost/cstdint.hpp> // for boost::uintmax_t #include <boost/cstdint.hpp> // for boost::uintmax_t
#include <boost/integer/integer_mask.hpp> // for boost::high_bit_mask_t, etc. #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/assert.hpp> // for BOOST_MPL_ASSERT_RELATION
#include <boost/mpl/range_c.hpp> // for boost::mpl::range_c #include <boost/mpl/range_c.hpp> // for boost::mpl::range_c
@ -30,8 +32,10 @@ namespace
boost::uintmax_t const one = 1u; boost::uintmax_t const one = 1u;
// List the ranges of template parameters tests (ranges are half-open) // List the ranges of template parameters tests (ranges are half-open)
typedef boost::mpl::range_c<std::size_t, 0u, 32u> high_bit_offsets; int const max_offset = std::numeric_limits<boost::uintmax_t>::digits;
typedef boost::mpl::range_c<std::size_t, 1u, 33u> low_bit_lengths;
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 } // unnamed namespace