mirror of
https://github.com/boostorg/integer.git
synced 2025-06-27 13:01:37 +02:00
Compare commits
16 Commits
boost-1.51
...
svn-branch
Author | SHA1 | Date | |
---|---|---|---|
2536a131ce | |||
1898e66238 | |||
cc73477d13 | |||
8457bd01b1 | |||
707faa1086 | |||
7bd48eb3f3 | |||
7c62277986 | |||
8368cd0a55 | |||
794fdf9bad | |||
cd98c4a257 | |||
84c8a52085 | |||
8a1d11f369 | |||
a5356bb254 | |||
2f13159023 | |||
6293af825a | |||
896f2a7654 |
@ -50,7 +50,6 @@ boostbook standalone
|
|||||||
<format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/libs/regex/doc/html
|
<format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/libs/regex/doc/html
|
||||||
;
|
;
|
||||||
|
|
||||||
install pdfinstall : standalone/<format>pdf : <location>. <install-type>PDF ;
|
install pdf-install : standalone : <location>. <install-type>PDF ;
|
||||||
explicit pdfinstall ;
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#include <boost/integer_traits.hpp> // for boost::::boost::integer_traits
|
#include <boost/integer_traits.hpp> // for boost::::boost::integer_traits
|
||||||
#include <boost/limits.hpp> // for ::std::numeric_limits
|
#include <boost/limits.hpp> // for ::std::numeric_limits
|
||||||
#include <boost/cstdint.hpp> // for boost::int64_t and BOOST_NO_INTEGRAL_INT64_T
|
#include <boost/cstdint.hpp> // for boost::int64_t and BOOST_NO_INTEGRAL_INT64_T
|
||||||
#include <boost/static_assert.hpp>
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// We simply cannot include this header on gcc without getting copious warnings of the kind:
|
// We simply cannot include this header on gcc without getting copious warnings of the kind:
|
||||||
@ -52,7 +51,6 @@ namespace boost
|
|||||||
|
|
||||||
// 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
|
|
||||||
|
|
||||||
// specializatons: 1=long, 2=int, 3=short, 4=signed char,
|
// specializatons: 1=long, 2=int, 3=short, 4=signed char,
|
||||||
// 6=unsigned long, 7=unsigned int, 8=unsigned short, 9=unsigned char
|
// 6=unsigned long, 7=unsigned int, 8=unsigned short, 9=unsigned char
|
||||||
@ -67,14 +65,14 @@ namespace boost
|
|||||||
template<> struct int_least_helper<4> { typedef short least; };
|
template<> struct int_least_helper<4> { typedef short least; };
|
||||||
template<> struct int_least_helper<5> { typedef signed char least; };
|
template<> struct int_least_helper<5> { typedef signed char least; };
|
||||||
#ifdef BOOST_HAS_LONG_LONG
|
#ifdef BOOST_HAS_LONG_LONG
|
||||||
template<> struct uint_least_helper<1> { typedef boost::ulong_long_type least; };
|
template<> struct int_least_helper<6> { typedef boost::ulong_long_type least; };
|
||||||
#elif defined(BOOST_HAS_MS_INT64)
|
#elif defined(BOOST_HAS_MS_INT64)
|
||||||
template<> struct uint_least_helper<1> { typedef unsigned __int64 least; };
|
template<> struct int_least_helper<6> { typedef unsigned __int64 least; };
|
||||||
#endif
|
#endif
|
||||||
template<> struct uint_least_helper<2> { typedef unsigned long least; };
|
template<> struct int_least_helper<7> { typedef unsigned long least; };
|
||||||
template<> struct uint_least_helper<3> { typedef unsigned int least; };
|
template<> struct int_least_helper<8> { typedef unsigned int least; };
|
||||||
template<> struct uint_least_helper<4> { typedef unsigned short least; };
|
template<> struct int_least_helper<9> { typedef unsigned short least; };
|
||||||
template<> struct uint_least_helper<5> { typedef unsigned char least; };
|
template<> struct int_least_helper<10> { typedef unsigned char least; };
|
||||||
|
|
||||||
template <int Bits>
|
template <int Bits>
|
||||||
struct exact_signed_base_helper{};
|
struct exact_signed_base_helper{};
|
||||||
@ -113,8 +111,6 @@ namespace boost
|
|||||||
template< int Bits > // bits (including sign) required
|
template< int Bits > // bits (including sign) required
|
||||||
struct int_t : public detail::exact_signed_base_helper<Bits>
|
struct int_t : public 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 detail::int_least_helper
|
||||||
<
|
<
|
||||||
#ifdef BOOST_HAS_LONG_LONG
|
#ifdef BOOST_HAS_LONG_LONG
|
||||||
@ -134,8 +130,6 @@ namespace boost
|
|||||||
template< int Bits > // bits required
|
template< int Bits > // bits required
|
||||||
struct uint_t : public detail::exact_unsigned_base_helper<Bits>
|
struct uint_t : public 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)
|
#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 =
|
||||||
@ -146,8 +140,9 @@ namespace boost
|
|||||||
(Bits <= ::std::numeric_limits<unsigned char>::digits));
|
(Bits <= ::std::numeric_limits<unsigned char>::digits));
|
||||||
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 detail::uint_least_helper
|
typedef typename detail::int_least_helper
|
||||||
<
|
<
|
||||||
|
5 +
|
||||||
#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
|
||||||
@ -222,7 +217,7 @@ namespace boost
|
|||||||
// 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 +
|
6 +
|
||||||
(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) +
|
||||||
(MaxValue <= ::boost::integer_traits<unsigned short>::const_max) +
|
(MaxValue <= ::boost::integer_traits<unsigned short>::const_max) +
|
||||||
@ -230,17 +225,18 @@ namespace boost
|
|||||||
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 +
|
5 +
|
||||||
(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) +
|
||||||
(MaxValue <= ::boost::integer_traits<unsigned int>::const_max) +
|
(MaxValue <= ::boost::integer_traits<unsigned int>::const_max) +
|
||||||
(MaxValue <= ::boost::integer_traits<unsigned short>::const_max) +
|
(MaxValue <= ::boost::integer_traits<unsigned short>::const_max) +
|
||||||
(MaxValue <= ::boost::integer_traits<unsigned char>::const_max));
|
(MaxValue <= ::boost::integer_traits<unsigned char>::const_max));
|
||||||
typedef typename detail::uint_least_helper< ::boost::uint_value_t<MaxValue>::which>::least least;
|
typedef typename detail::int_least_helper< ::boost::uint_value_t<MaxValue>::which>::least least;
|
||||||
#endif // BOOST_NO_INTEGRAL_INT64_T
|
#endif // BOOST_NO_INTEGRAL_INT64_T
|
||||||
#else
|
#else
|
||||||
typedef typename detail::uint_least_helper
|
typedef typename detail::int_least_helper
|
||||||
<
|
<
|
||||||
|
5 +
|
||||||
#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
|
||||||
|
@ -22,10 +22,4 @@ test-suite integer
|
|||||||
[ compile static_log2_include_test.cpp ]
|
[ compile static_log2_include_test.cpp ]
|
||||||
[ compile static_min_max_include_test.cpp ]
|
[ compile static_min_max_include_test.cpp ]
|
||||||
[ compile integer_fwd_include_test.cpp ]
|
[ compile integer_fwd_include_test.cpp ]
|
||||||
[ compile-fail fail_int_exact.cpp ]
|
|
||||||
[ compile-fail fail_int_fast.cpp ]
|
|
||||||
[ compile-fail fail_int_least.cpp ]
|
|
||||||
[ compile-fail fail_uint_exact.cpp ]
|
|
||||||
[ compile-fail fail_uint_fast.cpp ]
|
|
||||||
[ compile-fail fail_uint_least.cpp ]
|
|
||||||
;
|
;
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
// Copyright John Maddock 2012.
|
|
||||||
// Distributed under the Boost
|
|
||||||
// Software License, Version 1.0. (See accompanying file
|
|
||||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
|
|
||||||
#include <boost/integer.hpp>
|
|
||||||
|
|
||||||
typedef boost::int_t<sizeof(boost::intmax_t)*CHAR_BIT + 1>::exact fail_int_exact;
|
|
@ -1,8 +0,0 @@
|
|||||||
// Copyright John Maddock 2012.
|
|
||||||
// Distributed under the Boost
|
|
||||||
// Software License, Version 1.0. (See accompanying file
|
|
||||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
|
|
||||||
#include <boost/integer.hpp>
|
|
||||||
|
|
||||||
typedef boost::int_t<sizeof(boost::intmax_t)*CHAR_BIT + 1>::fast fail_int_fast;
|
|
@ -1,8 +0,0 @@
|
|||||||
// Copyright John Maddock 2012.
|
|
||||||
// Distributed under the Boost
|
|
||||||
// Software License, Version 1.0. (See accompanying file
|
|
||||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
|
|
||||||
#include <boost/integer.hpp>
|
|
||||||
|
|
||||||
typedef boost::int_t<sizeof(boost::intmax_t)*CHAR_BIT + 1>::least fail_int_least;
|
|
@ -1,8 +0,0 @@
|
|||||||
// Copyright John Maddock 2012.
|
|
||||||
// Distributed under the Boost
|
|
||||||
// Software License, Version 1.0. (See accompanying file
|
|
||||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
|
|
||||||
#include <boost/integer.hpp>
|
|
||||||
|
|
||||||
typedef boost::uint_t<sizeof(boost::intmax_t)*CHAR_BIT + 1>::exact fail_uint_exact;
|
|
@ -1,8 +0,0 @@
|
|||||||
// Copyright John Maddock 2012.
|
|
||||||
// Distributed under the Boost
|
|
||||||
// Software License, Version 1.0. (See accompanying file
|
|
||||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
|
|
||||||
#include <boost/integer.hpp>
|
|
||||||
|
|
||||||
typedef boost::uint_t<sizeof(boost::intmax_t)*CHAR_BIT + 1>::fast fail_uint_fast;
|
|
@ -1,8 +0,0 @@
|
|||||||
// Copyright John Maddock 2012.
|
|
||||||
// Distributed under the Boost
|
|
||||||
// Software License, Version 1.0. (See accompanying file
|
|
||||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
|
|
||||||
#include <boost/integer.hpp>
|
|
||||||
|
|
||||||
typedef boost::uint_t<sizeof(boost::intmax_t)*CHAR_BIT + 1>::least fail_uint_least;
|
|
Reference in New Issue
Block a user