From c8cb2b24a1c9c02781bf9e212aaad4548d95c257 Mon Sep 17 00:00:00 2001 From: nobody Date: Tue, 21 Mar 2006 02:26:31 +0000 Subject: [PATCH 01/31] This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'. [SVN r33417] From 7ce7ba6bfd17382d2cc32bb8eac0f73c1f51e278 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 26 Sep 2006 09:04:05 +0000 Subject: [PATCH 02/31] Changed test to reflect changes made to C99 in the TC. [SVN r35333] --- cstdint_test.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cstdint_test.cpp b/cstdint_test.cpp index 08c13be..88422de 100644 --- a/cstdint_test.cpp +++ b/cstdint_test.cpp @@ -113,10 +113,24 @@ void integral_constant_type_check(T1, T2) assert(sizeof(T1) == sizeof(T2)); assert(t1 == t2); #endif +#if defined(BOOST_HAS_STDINT_H) + // native headers are permitted to promote small + // unsigned types to type int: + if(sizeof(T1) >= sizeof(int)) + { + if(t1 > 0) + assert(t2 > 0); + else + assert(!(t2 > 0)); + } + else if(t1 < 0) + assert(!(t2 > 0)); +#else if(t1 > 0) assert(t2 > 0); else assert(!(t2 > 0)); +#endif } From 167961aba10a9887976850aa9231532f4e4893f5 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Sun, 25 Feb 2007 15:28:02 +0000 Subject: [PATCH 03/31] Correct testing bugs: either changing assert(...) or BOOST_ASSERT(...) to BOOST_TEST (in my code only) or adding "return boost::report_errors();" where it was clearly missing (and a pure bug, in anyone's code). or changing BOOST_TEST to BOOST_CHECK where the integer library was clearly using Boost.Test and not returning report_errors(). [SVN r37063] --- test/integer_mask_test.cpp | 8 ++--- test/static_log2_test.cpp | 2 +- test/static_min_max_test.cpp | 70 ++++++++++++++++++------------------ 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/test/integer_mask_test.cpp b/test/integer_mask_test.cpp index cbe3d87..6146ddf 100644 --- a/test/integer_mask_test.cpp +++ b/test/integer_mask_test.cpp @@ -19,16 +19,16 @@ #include // for std::cout (std::endl indirectly) -#define PRIVATE_HIGH_BIT_SLOW_TEST(v) BOOST_TEST( ::boost::high_bit_mask_t< \ +#define PRIVATE_HIGH_BIT_SLOW_TEST(v) BOOST_CHECK( ::boost::high_bit_mask_t< \ (v) >::high_bit == (1ul << (v)) ); -#define PRIVATE_HIGH_BIT_FAST_TEST(v) BOOST_TEST( ::boost::high_bit_mask_t< \ +#define PRIVATE_HIGH_BIT_FAST_TEST(v) BOOST_CHECK( ::boost::high_bit_mask_t< \ (v) >::high_bit_fast == (1ul << (v)) ); #define PRIVATE_HIGH_BIT_TEST(v) do { PRIVATE_HIGH_BIT_SLOW_TEST(v); \ PRIVATE_HIGH_BIT_FAST_TEST(v); } while (false) -#define PRIVATE_LOW_BITS_SLOW_TEST(v) BOOST_TEST( ::boost::low_bits_mask_t< \ +#define PRIVATE_LOW_BITS_SLOW_TEST(v) BOOST_CHECK( ::boost::low_bits_mask_t< \ (v) >::sig_bits == ((1ul << (v)) - 1) ); -#define PRIVATE_LOW_BITS_FAST_TEST(v) BOOST_TEST( ::boost::low_bits_mask_t< \ +#define PRIVATE_LOW_BITS_FAST_TEST(v) BOOST_CHECK( ::boost::low_bits_mask_t< \ (v) >::sig_bits_fast == ((1ul << (v)) - 1) ); #define PRIVATE_LOW_BITS_TEST(v) do { PRIVATE_LOW_BITS_SLOW_TEST(v); \ PRIVATE_LOW_BITS_FAST_TEST(v); } while (false) diff --git a/test/static_log2_test.cpp b/test/static_log2_test.cpp index d7b8d59..68628f6 100644 --- a/test/static_log2_test.cpp +++ b/test/static_log2_test.cpp @@ -20,7 +20,7 @@ // Macros to compact code -#define PRIVATE_LB_TEST( v, e ) BOOST_TEST( ::boost::static_log2::value == e ) +#define PRIVATE_LB_TEST( v, e ) BOOST_CHECK( ::boost::static_log2::value == e ) #define PRIVATE_PRINT_LB( v ) ::std::cout << "boost::static_log2<" << (v) \ << "> = " << ::boost::static_log2< (v) >::value << '.' << ::std::endl diff --git a/test/static_min_max_test.cpp b/test/static_min_max_test.cpp index 017b408..ed081f7 100644 --- a/test/static_min_max_test.cpp +++ b/test/static_min_max_test.cpp @@ -11,7 +11,7 @@ // 23 Sep 2001 Initial version (Daryle Walker) #define BOOST_INCLUDE_MAIN -#include // for main, BOOST_TEST +#include // for main, BOOST_CHECK #include // for boost::exit_success #include // for boost::static_signed_min, etc. @@ -37,57 +37,57 @@ test_main // Two positives cout << "Doing tests with two positive values." << endl; - BOOST_TEST( (static_signed_min< 9, 14>::value) == 9 ); - BOOST_TEST( (static_signed_max< 9, 14>::value) == 14 ); - BOOST_TEST( (static_signed_min<14, 9>::value) == 9 ); - BOOST_TEST( (static_signed_max<14, 9>::value) == 14 ); + BOOST_CHECK( (static_signed_min< 9, 14>::value) == 9 ); + BOOST_CHECK( (static_signed_max< 9, 14>::value) == 14 ); + BOOST_CHECK( (static_signed_min<14, 9>::value) == 9 ); + BOOST_CHECK( (static_signed_max<14, 9>::value) == 14 ); - BOOST_TEST( (static_unsigned_min< 9, 14>::value) == 9 ); - BOOST_TEST( (static_unsigned_max< 9, 14>::value) == 14 ); - BOOST_TEST( (static_unsigned_min<14, 9>::value) == 9 ); - BOOST_TEST( (static_unsigned_max<14, 9>::value) == 14 ); + BOOST_CHECK( (static_unsigned_min< 9, 14>::value) == 9 ); + BOOST_CHECK( (static_unsigned_max< 9, 14>::value) == 14 ); + BOOST_CHECK( (static_unsigned_min<14, 9>::value) == 9 ); + BOOST_CHECK( (static_unsigned_max<14, 9>::value) == 14 ); // Two negatives cout << "Doing tests with two negative values." << endl; - BOOST_TEST( (static_signed_min< -8, -101>::value) == -101 ); - BOOST_TEST( (static_signed_max< -8, -101>::value) == -8 ); - BOOST_TEST( (static_signed_min<-101, -8>::value) == -101 ); - BOOST_TEST( (static_signed_max<-101, -8>::value) == -8 ); + BOOST_CHECK( (static_signed_min< -8, -101>::value) == -101 ); + BOOST_CHECK( (static_signed_max< -8, -101>::value) == -8 ); + BOOST_CHECK( (static_signed_min<-101, -8>::value) == -101 ); + BOOST_CHECK( (static_signed_max<-101, -8>::value) == -8 ); // With zero cout << "Doing tests with zero and a positive or negative value." << endl; - BOOST_TEST( (static_signed_min< 0, 14>::value) == 0 ); - BOOST_TEST( (static_signed_max< 0, 14>::value) == 14 ); - BOOST_TEST( (static_signed_min<14, 0>::value) == 0 ); - BOOST_TEST( (static_signed_max<14, 0>::value) == 14 ); + BOOST_CHECK( (static_signed_min< 0, 14>::value) == 0 ); + BOOST_CHECK( (static_signed_max< 0, 14>::value) == 14 ); + BOOST_CHECK( (static_signed_min<14, 0>::value) == 0 ); + BOOST_CHECK( (static_signed_max<14, 0>::value) == 14 ); - BOOST_TEST( (static_unsigned_min< 0, 14>::value) == 0 ); - BOOST_TEST( (static_unsigned_max< 0, 14>::value) == 14 ); - BOOST_TEST( (static_unsigned_min<14, 0>::value) == 0 ); - BOOST_TEST( (static_unsigned_max<14, 0>::value) == 14 ); + BOOST_CHECK( (static_unsigned_min< 0, 14>::value) == 0 ); + BOOST_CHECK( (static_unsigned_max< 0, 14>::value) == 14 ); + BOOST_CHECK( (static_unsigned_min<14, 0>::value) == 0 ); + BOOST_CHECK( (static_unsigned_max<14, 0>::value) == 14 ); - BOOST_TEST( (static_signed_min< 0, -101>::value) == -101 ); - BOOST_TEST( (static_signed_max< 0, -101>::value) == 0 ); - BOOST_TEST( (static_signed_min<-101, 0>::value) == -101 ); - BOOST_TEST( (static_signed_max<-101, 0>::value) == 0 ); + BOOST_CHECK( (static_signed_min< 0, -101>::value) == -101 ); + BOOST_CHECK( (static_signed_max< 0, -101>::value) == 0 ); + BOOST_CHECK( (static_signed_min<-101, 0>::value) == -101 ); + BOOST_CHECK( (static_signed_max<-101, 0>::value) == 0 ); // With identical cout << "Doing tests with two identical values." << endl; - BOOST_TEST( (static_signed_min<0, 0>::value) == 0 ); - BOOST_TEST( (static_signed_max<0, 0>::value) == 0 ); - BOOST_TEST( (static_unsigned_min<0, 0>::value) == 0 ); - BOOST_TEST( (static_unsigned_max<0, 0>::value) == 0 ); + BOOST_CHECK( (static_signed_min<0, 0>::value) == 0 ); + BOOST_CHECK( (static_signed_max<0, 0>::value) == 0 ); + BOOST_CHECK( (static_unsigned_min<0, 0>::value) == 0 ); + BOOST_CHECK( (static_unsigned_max<0, 0>::value) == 0 ); - BOOST_TEST( (static_signed_min<14, 14>::value) == 14 ); - BOOST_TEST( (static_signed_max<14, 14>::value) == 14 ); - BOOST_TEST( (static_unsigned_min<14, 14>::value) == 14 ); - BOOST_TEST( (static_unsigned_max<14, 14>::value) == 14 ); + BOOST_CHECK( (static_signed_min<14, 14>::value) == 14 ); + BOOST_CHECK( (static_signed_max<14, 14>::value) == 14 ); + BOOST_CHECK( (static_unsigned_min<14, 14>::value) == 14 ); + BOOST_CHECK( (static_unsigned_max<14, 14>::value) == 14 ); - BOOST_TEST( (static_signed_min< -101, -101>::value) == -101 ); - BOOST_TEST( (static_signed_max< -101, -101>::value) == -101 ); + BOOST_CHECK( (static_signed_min< -101, -101>::value) == -101 ); + BOOST_CHECK( (static_signed_max< -101, -101>::value) == -101 ); return boost::exit_success; } From 4935afbcd4a10c29e0510bfe3a8861fb806a9676 Mon Sep 17 00:00:00 2001 From: nobody Date: Tue, 24 Jul 2007 19:28:14 +0000 Subject: [PATCH 04/31] This commit was manufactured by cvs2svn to create tag 'Version_1_34_1'. [SVN r38286] From b162db6b72f3f8c5a95ad00efce682f1ee0bafed Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Fri, 5 Oct 2007 14:25:06 +0000 Subject: [PATCH 05/31] Starting point for releases [SVN r39706] From 559b44c259917399670ba872c04744384627a8f6 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Sun, 25 Nov 2007 18:07:19 +0000 Subject: [PATCH 06/31] Full merge from trunk at revision 41356 of entire boost-root tree. [SVN r41369] --- include/boost/integer.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/integer.hpp b/include/boost/integer.hpp index aa8b22c..dc57dff 100644 --- a/include/boost/integer.hpp +++ b/include/boost/integer.hpp @@ -34,7 +34,7 @@ namespace boost template< int Category > struct int_least_helper {}; // default is empty // specializatons: 1=long, 2=int, 3=short, 4=signed char, - // 6=unsigned long, 7=unsigned int, 8=unsigned short, 9=unsigned long + // 6=unsigned long, 7=unsigned int, 8=unsigned short, 9=unsigned char // no specializations for 0 and 5: requests for a type > long are in error template<> struct int_least_helper<1> { typedef long least; }; template<> struct int_least_helper<2> { typedef int least; }; From 19ed0e48e0a409d9f3b45f010e10a04867a4b5ca Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Sun, 25 Nov 2007 18:38:02 +0000 Subject: [PATCH 07/31] Full merge from trunk at revision 41356 of entire boost-root tree. [SVN r41370] --- cstdint.htm | 11 +++++++---- doc/integer_mask.html | 9 ++++----- doc/static_min_max.html | 9 ++++----- index.html | 9 +++++++-- integer.htm | 9 ++++----- integer_traits.html | 9 +++++++-- 6 files changed, 33 insertions(+), 23 deletions(-) diff --git a/cstdint.htm b/cstdint.htm index 43b828f..9492827 100644 --- a/cstdint.htm +++ b/cstdint.htm @@ -2,7 +2,7 @@ - + Header boost/cstdint.hpp @@ -69,10 +69,13 @@ representing any value of any signed integer type.

capable of representing any value of any unsigned integer type.

These types are required.


-

Revised 19 Aug 2001 +

Revised 06 Nov 2007

-

 

+

© Copyright Beman Dawes 2000

+ +

Distributed under the Boost Software License, Version 1.0. See +www.boost.org/LICENSE_1_0.txt

- + \ No newline at end of file diff --git a/doc/integer_mask.html b/doc/integer_mask.html index 357b2c8..0328bbc 100644 --- a/doc/integer_mask.html +++ b/doc/integer_mask.html @@ -202,10 +202,9 @@ href="../../../people/daryle_walker.html">Daryle Walker.

Revised September 23, 2001

-

© Copyright Daryle Walker 2001. Permission to copy, use, -modify, sell and distribute this document is granted provided this -copyright notice appears in all copies. This document is provided -"as is" without express or implied warranty, and with no claim -as to its suitability for any purpose.

+

© Copyright Daryle Walker 2001. Use, modification, and distribution are +subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or a copy at <http://www.boost.org/LICENSE_1_0.txt>.)

diff --git a/doc/static_min_max.html b/doc/static_min_max.html index c9619ef..8163aa4 100644 --- a/doc/static_min_max.html +++ b/doc/static_min_max.html @@ -112,10 +112,9 @@ href="../../../people/daryle_walker.html">Daryle Walker.

Revised October 12, 2001

-

© Copyright Daryle Walker 2001. Permission to copy, use, -modify, sell and distribute this document is granted provided this -copyright notice appears in all copies. This document is provided -"as is" without express or implied warranty, and with no claim -as to its suitability for any purpose.

+

© Copyright Daryle Walker 2001. Use, modification, and distribution are +subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or a copy at <http://www.boost.org/LICENSE_1_0.txt>.)

diff --git a/index.html b/index.html index 7ab3ea0..0a6bbb0 100644 --- a/index.html +++ b/index.html @@ -121,8 +121,13 @@ instead.


-

Revised: 03 Oct 2001 +

Revised: 06 Nov 2007

+

© Copyright Beman Dawes 2003

+ +

Distributed under the Boost Software License, Version 1.0. See +www.boost.org/LICENSE_1_0.txt

+ - + \ No newline at end of file diff --git a/integer.htm b/integer.htm index 7ab168c..4dfd977 100644 --- a/integer.htm +++ b/integer.htm @@ -204,10 +204,9 @@ value-based sized templates.

Revised May 20, 2001

-

© Copyright Beman Dawes 1999. Permission to copy, use, modify, -sell and distribute this document is granted provided this copyright -notice appears in all copies. This document is provided "as -is" without express or implied warranty, and with no claim as to -its suitability for any purpose.

+

© Copyright Beman Dawes 1999. Use, modification, and distribution are +subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or a copy at <http://www.boost.org/LICENSE_1_0.txt>.)

\ No newline at end of file diff --git a/integer_traits.html b/integer_traits.html index b52b76a..6fc75b8 100644 --- a/integer_traits.html +++ b/integer_traits.html @@ -85,5 +85,10 @@ exercises the integer_traits class. Beman Dawes, Ed Brey, Steve Cleary, and Nathan Myers discussed the integer traits idea on the boost mailing list in August 1999.
- -Jens Maurer, 2000-02-20 \ No newline at end of file +

Revised +06 November 2007

+

© Copyright Beman Dawes 2000

+ +

Distributed under the Boost Software License, Version 1.0. See +www.boost.org/LICENSE_1_0.txt

+ From 550fe9d89f115e161daeccb4b8185c5e5d5fa735 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sat, 9 Feb 2008 13:27:00 +0000 Subject: [PATCH 08/31] Merged revisions 43129,43131,43137,43139-43140,43142,43144,43146,43149,43151,43153,43158,43160-43164,43167-43170,43172-43174,43178,43180-43193 via svnmerge from https://svn.boost.org/svn/boost/trunk ........ r43129 | danieljames | 2008-02-06 19:02:38 +0000 (Wed, 06 Feb 2008) | 2 lines In the boostbook navbar, link FAQ and people to the website. ........ r43188 | danieljames | 2008-02-09 12:29:02 +0000 (Sat, 09 Feb 2008) | 2 lines Fix a link in the intrusive redirect. ........ r43189 | danieljames | 2008-02-09 12:37:00 +0000 (Sat, 09 Feb 2008) | 1 line Fix another redirect link. ........ r43190 | danieljames | 2008-02-09 12:38:19 +0000 (Sat, 09 Feb 2008) | 1 line Update link to Jamfile, to link to the version 2 jamfile. ........ r43191 | danieljames | 2008-02-09 12:39:06 +0000 (Sat, 09 Feb 2008) | 1 line Fix a link. ........ r43192 | danieljames | 2008-02-09 12:45:32 +0000 (Sat, 09 Feb 2008) | 2 lines Add a forwarding header for hash/custom.html as Boost.Bimap links to it. ........ r43193 | danieljames | 2008-02-09 13:02:45 +0000 (Sat, 09 Feb 2008) | 1 line Fix the link to the license. ........ [SVN r43194] --- integer.htm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integer.htm b/integer.htm index 4dfd977..37f6c19 100644 --- a/integer.htm +++ b/integer.htm @@ -206,7 +206,7 @@ value-based sized templates.

© Copyright Beman Dawes 1999. Use, modification, and distribution are subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or a copy at <LICENSE_1_0.txt or a copy at <http://www.boost.org/LICENSE_1_0.txt>.)

- \ No newline at end of file + From 85e4d3e23d86dadc0f55a055cc8dca775eb0f91c Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 10 Feb 2008 16:39:38 +0000 Subject: [PATCH 09/31] Merged revisions 43206,43208-43213 via svnmerge from https://svn.boost.org/svn/boost/trunk ........ r43206 | danieljames | 2008-02-10 09:55:03 +0000 (Sun, 10 Feb 2008) | 1 line Fix some broken links. ........ r43209 | danieljames | 2008-02-10 14:56:22 +0000 (Sun, 10 Feb 2008) | 1 line Link to people pages on the website, as they've been removed from the download. ........ r43210 | danieljames | 2008-02-10 15:02:17 +0000 (Sun, 10 Feb 2008) | 1 line Point links to the pages that used to be in 'more' to the site. ........ r43212 | danieljames | 2008-02-10 16:10:16 +0000 (Sun, 10 Feb 2008) | 1 line Fix links on the home page as well. ........ r43213 | danieljames | 2008-02-10 16:21:22 +0000 (Sun, 10 Feb 2008) | 1 line Generated documentation which is no longer generated. ........ [SVN r43214] --- doc/integer_mask.html | 2 +- doc/static_log2.html | 2 +- doc/static_min_max.html | 2 +- index.html | 4 ++-- integer.htm | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/integer_mask.html b/doc/integer_mask.html index 0328bbc..5bc7301 100644 --- a/doc/integer_mask.html +++ b/doc/integer_mask.html @@ -196,7 +196,7 @@ contaimination of values by the higher, unused bits.

Credits

The author of the Boost bit mask class templates is Daryle Walker.

+href="http://www.boost.org/people/daryle_walker.html">Daryle Walker.


diff --git a/doc/static_log2.html b/doc/static_log2.html index e353da4..b77874c 100644 --- a/doc/static_log2.html +++ b/doc/static_log2.html @@ -186,7 +186,7 @@ code (and update old code as soon as possible).

The original version of the Boost binary logarithm class template was -written by Daryle Walker +written by Daryle Walker and then enhanced by Giovanni Bajo with support for compilers without partial template specialization. The current version was suggested, together with a reference implementation, by Vesa Karvonen. Gennaro Prota diff --git a/doc/static_min_max.html b/doc/static_min_max.html index 8163aa4..1beb503 100644 --- a/doc/static_min_max.html +++ b/doc/static_min_max.html @@ -106,7 +106,7 @@ class template.

Credits

The author of the Boost compile-time extrema class templates is Daryle Walker.

+href="http://www.boost.org/people/daryle_walker.html">Daryle Walker.


diff --git a/index.html b/index.html index 0a6bbb0..1f0f83c 100644 --- a/index.html +++ b/index.html @@ -10,8 +10,8 @@ boost.png (6897 bytes) Home Libraries - People - FAQ + People + FAQ More diff --git a/integer.htm b/integer.htm index 37f6c19..3d3f9c5 100644 --- a/integer.htm +++ b/integer.htm @@ -193,11 +193,11 @@ href="../../boost/cstdint.hpp"><boost/cstdint.hpp>.

Credits

The author of most of the Boost integer type choosing templates is Beman Dawes. He gives thanks +href="http://www.boost.org/people/beman_dawes.html">Beman Dawes. He gives thanks to Valentin Bonnard and - Kevlin Henney for sharing + Kevlin Henney for sharing their designs for similar templates. Daryle Walker designed the +href="http://www.boost.org/people/daryle_walker.html">Daryle Walker designed the value-based sized templates.


From 3531eb1ac573869b9fbaa479b467cdfe81877bf9 Mon Sep 17 00:00:00 2001 From: Boris Gubenko Date: Sun, 4 Jan 2009 05:17:02 +0000 Subject: [PATCH 10/31] merge tests and Jamfiles for 7 libraries [SVN r50456] --- test/Jamfile.v2 | 14 ++++++++++++++ cstdint_test.cpp => test/cstdint_test.cpp | 0 integer_test.cpp => test/integer_test.cpp | 0 .../integer_traits_test.cpp | 0 4 files changed, 14 insertions(+) create mode 100644 test/Jamfile.v2 rename cstdint_test.cpp => test/cstdint_test.cpp (100%) rename integer_test.cpp => test/integer_test.cpp (100%) rename integer_traits_test.cpp => test/integer_traits_test.cpp (100%) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 new file mode 100644 index 0000000..c17cf88 --- /dev/null +++ b/test/Jamfile.v2 @@ -0,0 +1,14 @@ +#~ Copyright Rene Rivera 2008 +#~ 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) + +import testing ; + +test-suite integer + : [ run integer_mask_test.cpp + /boost/test//boost_unit_test_framework ] + [ run static_log2_test.cpp + /boost/test//boost_test_exec_monitor/static ] + [ run static_min_max_test.cpp + /boost/test//boost_test_exec_monitor/static ] + ; diff --git a/cstdint_test.cpp b/test/cstdint_test.cpp similarity index 100% rename from cstdint_test.cpp rename to test/cstdint_test.cpp diff --git a/integer_test.cpp b/test/integer_test.cpp similarity index 100% rename from integer_test.cpp rename to test/integer_test.cpp diff --git a/integer_traits_test.cpp b/test/integer_traits_test.cpp similarity index 100% rename from integer_traits_test.cpp rename to test/integer_traits_test.cpp From 382eabdff50a9073731c96090bf404f7e6fe4626 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 14 Jan 2009 10:18:19 +0000 Subject: [PATCH 11/31] fixes #2654. [SVN r50573] --- include/boost/cstdint.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 31a432a..d55a484 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -36,7 +36,7 @@ // this is triggered with GCC, because it defines __cplusplus < 199707L # define BOOST_NO_INT64_T # endif -# elif defined(__FreeBSD__) || defined(__IBMCPP__) +# elif defined(__FreeBSD__) || defined(__IBMCPP__) || defined(_AIX) # include # else # include From 1b9549693acd7be526f9f71a7eefb20f5127be56 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Tue, 20 Jan 2009 01:54:06 +0000 Subject: [PATCH 12/31] Merge from trunk [SVN r50681] --- test/Jamfile.v2 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index c17cf88..1609bf5 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -5,10 +5,16 @@ import testing ; test-suite integer - : [ run integer_mask_test.cpp + : [ run cstdint_test.cpp ] + [ run integer_test.cpp + /boost/test//boost_unit_test_framework ] + [ run integer_traits_test.cpp + /boost/test//boost_test_exec_monitor/static ] + [ run integer_mask_test.cpp /boost/test//boost_unit_test_framework ] [ run static_log2_test.cpp /boost/test//boost_test_exec_monitor/static ] [ run static_min_max_test.cpp /boost/test//boost_test_exec_monitor/static ] +# [ compile issue_2134.cpp ] ; From e6bbb336608ac6762148a299b3b1b22ba1ada7e6 Mon Sep 17 00:00:00 2001 From: "Troy D. Straszheim" Date: Sat, 24 Jan 2009 18:57:20 +0000 Subject: [PATCH 13/31] merge of cmake build files from trunk per beman [SVN r50756] --- CMakeLists.txt | 25 +++++++++++++++++++++++++ module.cmake | 1 + test/CMakeLists.txt | 8 ++++++++ 3 files changed, 34 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 module.cmake create mode 100644 test/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..2241512 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,25 @@ +#---------------------------------------------------------------------------- +# This file was automatically generated from the original CMakeLists.txt file +# Add a variable to hold the headers for the library +set (lib_headers + integer.hpp + integer_fwd.hpp + integer_traits.hpp + integer +) + +# Add a library target to the build system +boost_library_project( + integer + # SRCDIRS + TESTDIRS test + HEADERS ${lib_headers} + # DOCDIRS + DESCRIPTION "The organization of boost integer headers and classes is designed to take advantage of types from the 1999 C standard without resorting to undefined behavior in terms of the 1998 C++ standard. The header makes the standard integer types safely available in namespace boost without placing any names in namespace std." + MODULARIZED + AUTHORS "Beman Dawes " + "Daryle Walker " + # MAINTAINERS +) + + diff --git a/module.cmake b/module.cmake new file mode 100644 index 0000000..d0c4293 --- /dev/null +++ b/module.cmake @@ -0,0 +1 @@ +boost_module(integer DEPENDS utility) \ No newline at end of file diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..0b09839 --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,8 @@ +boost_additional_test_dependencies(integer BOOST_DEPENDS test) + +boost_test_run(cstdint_test cstdint_test.cpp) +boost_test_run(integer_mask_test integer_mask_test.cpp DEPENDS boost_test_exec_monitor) +boost_test_run(integer_test integer_test.cpp DEPENDS boost_test_exec_monitor) +boost_test_run(integer_traits_test integer_traits_test.cpp DEPENDS boost_test_exec_monitor) +boost_test_run(static_log2_test static_log2_test.cpp DEPENDS boost_test_exec_monitor) +boost_test_run(static_min_max_test static_min_max_test.cpp DEPENDS boost_test_exec_monitor) From 12e2311aa49d030e32abfb729a64dc84d5e528fe Mon Sep 17 00:00:00 2001 From: Boris Gubenko Date: Sat, 31 Jan 2009 21:37:54 +0000 Subject: [PATCH 14/31] add missing #include to integer_mask_test.cpp [SVN r50935] --- test/integer_mask_test.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/integer_mask_test.cpp b/test/integer_mask_test.cpp index 6146ddf..38f5211 100644 --- a/test/integer_mask_test.cpp +++ b/test/integer_mask_test.cpp @@ -10,8 +10,7 @@ // Revision History // 23 Sep 2001 Initial version (Daryle Walker) -#define BOOST_INCLUDE_MAIN -#include // for main +#include // for main #include // for boost::exit_success #include // for boost::high_bit_mask_t, etc. From dcdfca5f38ce4fea70d4426fdd9dec88a1ed2c01 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 12 Jul 2009 16:11:26 +0000 Subject: [PATCH 15/31] Use BOOST_STATIC_CONSTANT in static_log2, as g++ 4.0 has problems with enum. Merged revisions 54811 via svnmerge from https://svn.boost.org/svn/boost/trunk [SVN r54911] --- include/boost/integer/static_log2.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/integer/static_log2.hpp b/include/boost/integer/static_log2.hpp index 19e048b..219a48e 100644 --- a/include/boost/integer/static_log2.hpp +++ b/include/boost/integer/static_log2.hpp @@ -48,7 +48,7 @@ namespace boost { template struct choose_initial_n { - enum { c = (argument_type(1) << n << n) != 0 }; + BOOST_STATIC_CONSTANT(bool, c = (argument_type(1) << n << n) != 0); BOOST_STATIC_CONSTANT( result_type, value = !c*n + choose_initial_n<2*c*n>::value @@ -85,7 +85,7 @@ namespace boost { template struct static_log2_impl { - enum { c = (x >> n) > 0 }; // x >= 2**n ? + BOOST_STATIC_CONSTANT(bool, c = (x >> n) > 0); // x >= 2**n ? BOOST_STATIC_CONSTANT( result_type, value = c*n + (static_log2_impl< (x>>c*n), n/2 >::value) From a1bf7131b3c0dbb372a4c6b15f0357b4c7397498 Mon Sep 17 00:00:00 2001 From: "Troy D. Straszheim" Date: Wed, 22 Jul 2009 21:51:01 +0000 Subject: [PATCH 16/31] Add basic copyright/license to keep cmake out of the inspection report [SVN r55095] --- CMakeLists.txt | 6 ++++++ test/CMakeLists.txt | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2241512..c952ed0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,9 @@ +# +# Copyright Troy D. Straszheim +# +# Distributed under the Boost Software License, Version 1.0. +# See http://www.boost.org/LICENSE_1_0.txt +# #---------------------------------------------------------------------------- # This file was automatically generated from the original CMakeLists.txt file # Add a variable to hold the headers for the library diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0b09839..acc48e6 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,3 +1,9 @@ +# +# Copyright Troy D. Straszheim +# +# Distributed under the Boost Software License, Version 1.0. +# See http://www.boost.org/LICENSE_1_0.txt +# boost_additional_test_dependencies(integer BOOST_DEPENDS test) boost_test_run(cstdint_test cstdint_test.cpp) From be17e798df329ec8d525b5d1b135d928a48e1abe Mon Sep 17 00:00:00 2001 From: "Troy D. Straszheim" Date: Sat, 17 Oct 2009 01:10:45 +0000 Subject: [PATCH 17/31] rm cmake from the release branch before it goes out broken. Policy dictates that you never commit to release, you commit to trunk and merge to release. [SVN r56941] --- CMakeLists.txt | 31 ------------------------------- module.cmake | 1 - test/CMakeLists.txt | 14 -------------- 3 files changed, 46 deletions(-) delete mode 100644 CMakeLists.txt delete mode 100644 module.cmake delete mode 100644 test/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index c952ed0..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -# -# Copyright Troy D. Straszheim -# -# Distributed under the Boost Software License, Version 1.0. -# See http://www.boost.org/LICENSE_1_0.txt -# -#---------------------------------------------------------------------------- -# This file was automatically generated from the original CMakeLists.txt file -# Add a variable to hold the headers for the library -set (lib_headers - integer.hpp - integer_fwd.hpp - integer_traits.hpp - integer -) - -# Add a library target to the build system -boost_library_project( - integer - # SRCDIRS - TESTDIRS test - HEADERS ${lib_headers} - # DOCDIRS - DESCRIPTION "The organization of boost integer headers and classes is designed to take advantage of types from the 1999 C standard without resorting to undefined behavior in terms of the 1998 C++ standard. The header makes the standard integer types safely available in namespace boost without placing any names in namespace std." - MODULARIZED - AUTHORS "Beman Dawes " - "Daryle Walker " - # MAINTAINERS -) - - diff --git a/module.cmake b/module.cmake deleted file mode 100644 index d0c4293..0000000 --- a/module.cmake +++ /dev/null @@ -1 +0,0 @@ -boost_module(integer DEPENDS utility) \ No newline at end of file diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt deleted file mode 100644 index acc48e6..0000000 --- a/test/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -# -# Copyright Troy D. Straszheim -# -# Distributed under the Boost Software License, Version 1.0. -# See http://www.boost.org/LICENSE_1_0.txt -# -boost_additional_test_dependencies(integer BOOST_DEPENDS test) - -boost_test_run(cstdint_test cstdint_test.cpp) -boost_test_run(integer_mask_test integer_mask_test.cpp DEPENDS boost_test_exec_monitor) -boost_test_run(integer_test integer_test.cpp DEPENDS boost_test_exec_monitor) -boost_test_run(integer_traits_test integer_traits_test.cpp DEPENDS boost_test_exec_monitor) -boost_test_run(static_log2_test static_log2_test.cpp DEPENDS boost_test_exec_monitor) -boost_test_run(static_min_max_test static_min_max_test.cpp DEPENDS boost_test_exec_monitor) From 730be18188c4c073c35f941fc9248693287d9e17 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Mon, 5 Apr 2010 07:41:52 +0000 Subject: [PATCH 18/31] Merge link fix for integer. [SVN r61060] --- doc/html/boost_integer/cstdint.html | 60 +++--- doc/html/boost_integer/history.html | 20 +- doc/html/boost_integer/integer.html | 304 ++++++++++++++-------------- doc/html/boost_integer/log2.html | 20 +- doc/html/boost_integer/mask.html | 225 ++++++++++---------- doc/html/boost_integer/minmax.html | 16 +- doc/html/boost_integer/traits.html | 86 ++++---- doc/html/index.html | 182 ++++++++--------- doc/integer.qbk | 2 +- 9 files changed, 460 insertions(+), 455 deletions(-) diff --git a/doc/html/boost_integer/cstdint.html b/doc/html/boost_integer/cstdint.html index d233f43..b709cfc 100644 --- a/doc/html/boost_integer/cstdint.html +++ b/doc/html/boost_integer/cstdint.html @@ -3,7 +3,7 @@ Standard Integer Types - + @@ -22,7 +22,7 @@
PrevUpHomeNext
-
+ -
+
@@ -62,7 +62,7 @@ a test program.

-
+
@@ -82,7 +82,7 @@ conventions rather than C++ Standard Library header naming conventions.

-
+
@@ -99,7 +99,7 @@ Use the respective names in namespace boost instead.

-
+

Exact-width integer types @@ -119,7 +119,7 @@ The absence of int64_t and uint64_t is indicated by the macro BOOST_NO_INT64_T.

-
+

Minimum-width integer types @@ -137,27 +137,27 @@

The following minimum-width integer types are provided for all platforms:

-
    -
  • int_least8_t
  • -
  • int_least16_t
  • -
  • int_least32_t
  • -
  • uint_least8_t
  • -
  • uint_least16_t
  • -
  • uint_least32_t
  • +
      +
    • int_least8_t
    • +
    • int_least16_t
    • +
    • int_least32_t
    • +
    • uint_least8_t
    • +
    • uint_least16_t
    • +
    • uint_least32_t

    The following types are available only if, after including <boost/cstdint.hpp>, the macro BOOST_NO_INT64_T is not defined:

    -
      -
    • int_least64_t
    • -
    • uint_least64_t
    • +
        +
      • int_least64_t
      • +
      • uint_least64_t

      All other minimum-width integer types are optional.

    -
    +

    Fastest minimum-width integer types @@ -175,27 +175,27 @@

    The following fastest minimum-width integer types are provided for all platforms:

    -
      -
    • int_fast8_t
    • -
    • int_fast16_t
    • -
    • int_fast32_t
    • -
    • uint_fast8_t
    • -
    • uint_fast16_t
    • -
    • uint_fast32_t
    • +
        +
      • int_fast8_t
      • +
      • int_fast16_t
      • +
      • int_fast32_t
      • +
      • uint_fast8_t
      • +
      • uint_fast16_t
      • +
      • uint_fast32_t

      The following types are available only if, after including <boost/cstdint.hpp>, the macro BOOST_NO_INT64_T is not defined:

      -
        -
      • int_fast64_t
      • -
      • uint_fast64_t
      • +
          +
        • int_fast64_t
        • +
        • uint_fast64_t

        All other fastest minimum-width integer types are optional.

      -
      +

      Greatest-width integer types @@ -212,7 +212,7 @@ These types are provided for all platforms.

      -
      +

      Integer Constant Macros diff --git a/doc/html/boost_integer/history.html b/doc/html/boost_integer/history.html index b92217e..3d6cb39 100644 --- a/doc/html/boost_integer/history.html +++ b/doc/html/boost_integer/history.html @@ -3,7 +3,7 @@ History - + @@ -21,19 +21,19 @@
      PrevUpHome
      -
      +
      - + 1.42.0
      -
        -
      • +
          +
        • Reverted Trunk to release branch state (i.e. a "known good state").
        • -
        • +
        • Fixed issues: 653, 3084, 3177, @@ -42,12 +42,12 @@ 3657, 2134.
        • -
        • +
        • Added long long support to boost::static_log2, boost::static_signed_min, boost::static_signed_max, boost::static_unsigned_minboost::static_unsigned_max, when available.
        • -
        • +
        • The argument type and the result type of boost::static_signed_min etc are now typedef'd. Formerly, they were hardcoded as unsigned long and int respectively. Please, use the provided @@ -55,10 +55,10 @@
        - + 1.32.0
        -
        • +
          • The argument type and the result type of boost::static_log2 are now typedef'd. Formerly, they were hardcoded as unsigned long and int respectively. Please, use the provided typedefs diff --git a/doc/html/boost_integer/integer.html b/doc/html/boost_integer/integer.html index 8c022fa..4078a26 100644 --- a/doc/html/boost_integer/integer.html +++ b/doc/html/boost_integer/integer.html @@ -3,7 +3,7 @@ Integer Type Selection - + @@ -22,7 +22,7 @@
            PrevUpHomeNext
            -
            +
            @@ -44,7 +44,7 @@ characteristics such as number of bits or maximum value. This facility is particularly useful for solving generic programming problems.

            -
            +
            @@ -102,7 +102,7 @@ } // namespace boost
            -
            +

            Easiest-to-Manipulate Types @@ -126,7 +126,7 @@ the input type.

            -
            +
            @@ -139,7 +139,7 @@ fast. The following table describes each template's criteria.

            -

            Table 1. Criteria for the Sized Type Class Templates

            +

            Table 1. Criteria for the Sized Type Class Templates

            @@ -147,199 +147,201 @@ +

            + Class Template +

            + +

            + Template Parameter Mapping +

            + +

            + boost::int_t<N>::least +

            + +

            + The smallest, built-in, signed integral type with at least N + bits, including the sign bit. The parameter should be a positive + number. A compile-time error results if the parameter is larger + than the number of bits in the largest integer type. +

            + +

            + boost::int_t<N>::fast +

            + +

            + The easiest-to-manipulate, built-in, signed integral type with + at least N bits, including the sign bit. The + parameter should be a positive number. A compile-time error results + if the parameter is larger than the number of bits in the largest + integer type. +

            + +

            + boost::int_t<N>::exact +

            + +

            + A built-in, signed integral type with exactly N + bits, including the sign bit. The parameter should be a positive + number. Note that the member exact is defined + only if there exists a type with + exactly N bits. +

            + +

            + boost::uint_t<N>::least +

            + +

            + The smallest, built-in, unsigned integral type with at least N + bits. The parameter should be a positive number. A compile-time + error results if the parameter is larger than the number of bits + in the largest integer type. +

            + +

            + boost::uint_t<N>::fast +

            + +

            + The easiest-to-manipulate, built-in, unsigned integral type with + at least N bits. The parameter should be a + positive number. A compile-time error results if the parameter + is larger than the number of bits in the largest integer type. +

            + +

            + boost::uint_t<N>::exact +

            + +

            + A built-in, unsigned integral type with exactly N + bits. The parameter should be a positive number. A compile-time + error results if the parameter is larger than the number of bits + in the largest integer type. Note that the member exact + is defined only if there exists + a type with exactly N bits. +

            + +

            + boost::int_max_value_t<V>::last +

            + +

            + The smallest, built-in, signed integral type that can hold all + the values in the inclusive range 0 - V. The + parameter should be a positive number. +

            + +

            + boost::int_max_value_t<V>::fast +

            + +

            + The easiest-to-manipulate, built-in, signed integral type that + can hold all the values in the inclusive range 0 - V. + The parameter should be a positive number. +

            + +

            + boost::int_min_value_t<V>::least +

            + +

            + The smallest, built-in, signed integral type that can hold all + the values in the inclusive range V - 0. The + parameter should be a negative number. +

            + +

            + boost::int_min_value_t<V>::fast +

            + +

            + The easiest-to-manipulate, built-in, signed integral type that + can hold all the values in the inclusive range V - 0. + The parameter should be a negative number. +

            + +

            + boost::uint_value_t<V>::least +

            + +

            + The smallest, built-in, unsigned integral type that can hold all + positive values up to and including V. The + parameter should be a positive number. +

            + +

            + boost::uint_value_t<V>::fast +

            + +

            + The easiest-to-manipulate, built-in, unsigned integral type that + can hold all positive values up to and including V. + The parameter should be a positive number. +

            +
            -

            - Class Template -

            -
            -

            - Template Parameter Mapping -

            -
            -

            - boost::int_t<N>::least -

            -
            -

            - The smallest, built-in, signed integral type with at least N - bits, including the sign bit. The parameter should be a positive number. - A compile-time error results if the parameter is larger than the number - of bits in the largest integer type. -

            -
            -

            - boost::int_t<N>::fast -

            -
            -

            - The easiest-to-manipulate, built-in, signed integral type with at least - N bits, including the sign bit. The parameter - should be a positive number. A compile-time error results if the parameter - is larger than the number of bits in the largest integer type. -

            -
            -

            - boost::int_t<N>::exact -

            -
            -

            - A built-in, signed integral type with exactly N - bits, including the sign bit. The parameter should be a positive number. - Note that the member exact is defined only if there exists a type with exactly N - bits. -

            -
            -

            - boost::uint_t<N>::least -

            -
            -

            - The smallest, built-in, unsigned integral type with at least N - bits. The parameter should be a positive number. A compile-time error - results if the parameter is larger than the number of bits in the largest - integer type. -

            -
            -

            - boost::uint_t<N>::fast -

            -
            -

            - The easiest-to-manipulate, built-in, unsigned integral type with at - least N bits. The parameter should be a positive - number. A compile-time error results if the parameter is larger than - the number of bits in the largest integer type. -

            -
            -

            - boost::uint_t<N>::exact -

            -
            -

            - A built-in, unsigned integral type with exactly N - bits. The parameter should be a positive number. A compile-time error - results if the parameter is larger than the number of bits in the largest - integer type. Note that the member exact is defined - only if there exists a type with exactly - N bits. -

            -
            -

            - boost::int_max_value_t<V>::last -

            -
            -

            - The smallest, built-in, signed integral type that can hold all the - values in the inclusive range 0 - V. The parameter - should be a positive number. -

            -
            -

            - boost::int_max_value_t<V>::fast -

            -
            -

            - The easiest-to-manipulate, built-in, signed integral type that can - hold all the values in the inclusive range 0 - V. - The parameter should be a positive number. -

            -
            -

            - boost::int_min_value_t<V>::least -

            -
            -

            - The smallest, built-in, signed integral type that can hold all the - values in the inclusive range V - 0. The parameter - should be a negative number. -

            -
            -

            - boost::int_min_value_t<V>::fast -

            -
            -

            - The easiest-to-manipulate, built-in, signed integral type that can - hold all the values in the inclusive range V - 0. - The parameter should be a negative number. -

            -
            -

            - boost::uint_value_t<V>::least -

            -
            -

            - The smallest, built-in, unsigned integral type that can hold all positive - values up to and including V. The parameter should - be a positive number. -

            -
            -

            - boost::uint_value_t<V>::fast -

            -
            -

            - The easiest-to-manipulate, built-in, unsigned integral type that can - hold all positive values up to and including V. - The parameter should be a positive number. -

            -

            -
            +
            @@ -361,7 +363,7 @@ }
            -
            +

            Demonstration Program @@ -372,27 +374,27 @@ of the sized type class templates.

            -
            +

            The rationale for the design of the templates in this header includes:

            -
              -
            • +
                +
              • Avoid recursion because of concern about C++'s limited guaranteed recursion depth (17).
              • -
              • +
              • Avoid macros on general principles.
              • -
              • +
              • Try to keep the design as simple as possible.
            -
            +
            @@ -401,7 +403,7 @@ to use the types supplied in <boost/cstdint.hpp>.

            -
            +
            diff --git a/doc/html/boost_integer/log2.html b/doc/html/boost_integer/log2.html index cb234bd..44669ae 100644 --- a/doc/html/boost_integer/log2.html +++ b/doc/html/boost_integer/log2.html @@ -3,7 +3,7 @@ Compile Time log2 Calculation - + @@ -22,7 +22,7 @@
            PrevUpHomeNext
            -
            +
            @@ -39,7 +39,7 @@ determines the position of the highest bit in a given value. This facility is useful for solving generic programming problems.

            -
            +
            @@ -66,7 +66,7 @@ } // namespace boost
            -
            +
            @@ -85,18 +85,18 @@

            Note:

            -
              -
            • +
                +
              • static_log2_argument_type is an unsigned integer type (C++ standard, 3.9.1p3).
              • -
              • +
              • static_log2_result_type is an integer type (C++ standard, 3.9.1p7).
            -
            +

            Demonstration Program @@ -107,7 +107,7 @@ of the binary logarithm class template.

            -
            +
            @@ -120,7 +120,7 @@ to be available statically (i.e. at compile-time).

            -
            +
            diff --git a/doc/html/boost_integer/mask.html b/doc/html/boost_integer/mask.html index f7bfc12..ff9972f 100644 --- a/doc/html/boost_integer/mask.html +++ b/doc/html/boost_integer/mask.html @@ -3,7 +3,7 @@ Integer Masks - + @@ -22,7 +22,7 @@
            PrevUpHomeNext
            -
            +
            @@ -41,7 +41,7 @@
            Rationale
            Credits
            -
            +
            @@ -52,7 +52,7 @@ type selection templates header.

            -
            +
            @@ -90,7 +90,7 @@ } // namespace boost
            -
            +

            Single Bit-Mask Class Template @@ -105,7 +105,7 @@ of high_bit_mask_t.

            -

            Table 2. Members of the `boost::high_bit_mask_t` Class Template

            +

            Table 2. Members of the `boost::high_bit_mask_t` Class Template

            @@ -113,84 +113,85 @@ +

            + Member +

            + +

            + Meaning +

            + +

            + least +

            + +

            + The smallest, unsigned, built-in type that supports the given bit + position. +

            + +

            + fast +

            + +

            + The easiest-to-manipulate analog of least. +

            + +

            + high_bit +

            + +

            + A least constant of the value 2Bit. +

            + +

            + high_bit_fast +

            + +

            + A fast analog of high_bit. +

            + +

            + bit_position +

            + +

            + The value of the template parameter, in case its needed from a + renamed instantiation of the class template. +

            +
            -

            - Member -

            -
            -

            - Meaning -

            -
            -

            - least -

            -
            -

            - The smallest, unsigned, built-in type that supports the given bit position. -

            -
            -

            - fast -

            -
            -

            - The easiest-to-manipulate analog of least. -

            -
            -

            - high_bit -

            -
            -

            - A least constant of the value 2Bit. -

            -
            -

            - high_bit_fast -

            -
            -

            - A fast analog of high_bit. -

            -
            -

            - bit_position -

            -
            -

            - The value of the template parameter, in case its needed from a renamed - instantiation of the class template. -

            -

            -
            +

            Group Bit-Mask Class Template @@ -204,7 +205,7 @@ type. The following table describes the members of low_bits_mask_t.

            -

            Table 3. Members of the [^boost::low_bits_mask_t] Class Template

            +

            Table 3. Members of the [^boost::low_bits_mask_t] Class Template

            @@ -212,84 +213,86 @@ +

            + Member +

            + +

            + Meaning +

            + +

            + least +

            + +

            + The smallest, unsigned built-in type that supports the given bit + count. +

            + +

            + fast +

            + +

            + The easiest-to-manipulate analog of least. +

            + +

            + sig_bits +

            + +

            + A least constant of the desired bit-masking + value. +

            + +

            + sig_bits_fast +

            + +

            + A fast analog of sig_bits. +

            + +

            + bit_count +

            + +

            + The value of the template parameter, in case its needed from a + renamed instantiation of the class template. +

            +
            -

            - Member -

            -
            -

            - Meaning -

            -
            -

            - least -

            -
            -

            - The smallest, unsigned built-in type that supports the given bit count. -

            -
            -

            - fast -

            -
            -

            - The easiest-to-manipulate analog of least. -

            -
            -

            - sig_bits -

            -
            -

            - A least constant of the desired bit-masking value. -

            -
            -

            - sig_bits_fast -

            -
            -

            - A fast analog of sig_bits. -

            -
            -

            - bit_count -

            -
            -

            - The value of the template parameter, in case its needed from a renamed - instantiation of the class template. -

            -

            -
            +

            Implementation Notes @@ -301,7 +304,7 @@ bit counts.

            -
            +
            @@ -325,7 +328,7 @@ }
            -
            +

            Demonstration Program @@ -336,7 +339,7 @@ of the bit mask class templates.

            -
            +
            @@ -348,7 +351,7 @@ bits. This prevents contamination of values by the higher, unused bits.

            -
            +
            diff --git a/doc/html/boost_integer/minmax.html b/doc/html/boost_integer/minmax.html index 7b1fea0..7e8d396 100644 --- a/doc/html/boost_integer/minmax.html +++ b/doc/html/boost_integer/minmax.html @@ -3,7 +3,7 @@ Compile time min/max calculation - + @@ -22,7 +22,7 @@
            PrevUpHomeNext
            -
            +
            @@ -40,7 +40,7 @@ provide a compile-time evaluation of the minimum or maximum of two integers. These facilities are useful for generic programming problems.

            -
            +
            @@ -65,7 +65,7 @@ }
            -
            +
            @@ -77,7 +77,7 @@ which is set to the respective minimum or maximum of the template's parameters.

            -
            +
            @@ -112,7 +112,7 @@ }
            -
            +

            Demonstration Program @@ -123,7 +123,7 @@ extrema class templates.

            -
            +
            @@ -133,7 +133,7 @@ another class template.

            -
            +
            diff --git a/doc/html/boost_integer/traits.html b/doc/html/boost_integer/traits.html index 7c197d7..d60fef3 100644 --- a/doc/html/boost_integer/traits.html +++ b/doc/html/boost_integer/traits.html @@ -3,7 +3,7 @@ Integer Traits - + @@ -22,7 +22,7 @@
            PrevUpHomeNext
            -
            + -
            +
            @@ -62,7 +62,7 @@ The template class integer_traits addresses this problem.

            -
            +
            @@ -82,7 +82,7 @@ }
            -
            +
            @@ -102,71 +102,71 @@ -

            - member -

            +

            + member +

            -

            - type -

            +

            + type +

            -

            - value -

            +

            + value +

            -

            - is_integral -

            +

            + is_integral +

            -

            - bool -

            +

            + bool +

            -

            - true -

            +

            + true +

            -

            - const_min -

            +

            + const_min +

            -

            - T -

            +

            + T +

            -

            - equivalent to std::numeric_limits<T>::min() -

            +

            + equivalent to std::numeric_limits<T>::min() +

            -

            - const_max -

            +

            + const_max +

            -

            - T -

            +

            + T +

            -

            - equivalent to std::numeric_limits<T>::max() -

            +

            + equivalent to std::numeric_limits<T>::max() +

            @@ -179,7 +179,7 @@ unless boost::integer_traits is also specialized.

            -
            +
            @@ -188,7 +188,7 @@ exercises the integer_traits class.

            -
            +
            diff --git a/doc/html/index.html b/doc/html/index.html index 97bf531..1e4d3da 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -3,7 +3,7 @@ Boost.Integer - + @@ -18,7 +18,7 @@
            Next
            -
            +

            @@ -39,8 +39,8 @@

            -
            -

            +

            +

            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)

            @@ -61,7 +61,7 @@
            History
            -
            +
            @@ -84,152 +84,152 @@ -

            - Component -

            +

            + Component +

            -

            - Header -

            +

            + Header +

            -

            - Purpose -

            +

            + Purpose +

            -

            - Forward Declarations. -

            +

            + Forward Declarations. +

            -

            - <boost/integer_fwd.hpp> -

            +

            + <boost/integer_fwd.hpp> +

            -

            - Forward declarations of classes and class templates - for use when - just the name of a class is needed. -

            +

            + Forward declarations of classes and class templates - for use when + just the name of a class is needed. +

            -

            - Standard Integer Types. -

            +

            + Standard Integer Types. +

            -

            - <boost/cstdint.hpp> -

            +

            + <boost/cstdint.hpp> +

            -

            - Provides typedef's based on the 1999 C Standard header <stdint.h>, wrapped in namespace boost. This - implementation may #include the compiler supplied <stdint.h>, - if present. -

            +

            + Provides typedef's based on the 1999 C Standard header <stdint.h>, wrapped in namespace boost. + This implementation may #include the compiler supplied <stdint.h>, if present. +

            -

            - Integer Traits. -

            +

            + Integer Traits. +

            -

            - <boost/integer_traits.hpp> -

            +

            + <boost/integer_traits.hpp> +

            -

            - Class template boost::integer_traits, derives from - std::numeric_limits and adds const_min - and const_max members. -

            +

            + Class template boost::integer_traits, derives + from std::numeric_limits and adds const_min + and const_max members. +

            -

            - Integer Type Selection. -

            +

            + Integer Type Selection. +

            -

            - <boost/integer.hpp> -

            +

            + <boost/integer.hpp> +

            -

            - Templates for integer type selection based on properties such as maximum - value or number of bits: Use to select the type of an integer when - some property such as maximum value or number of bits is known. Useful - for generic programming. -

            +

            + Templates for integer type selection based on properties such as + maximum value or number of bits: Use to select the type of an integer + when some property such as maximum value or number of bits is known. + Useful for generic programming. +

            -

            - Integer Masks. -

            +

            + Integer Masks. +

            -

            - <boost/integer/integer_mask.hpp> -

            +

            + <boost/integer/integer_mask.hpp> +

            -

            - Templates for the selection of integer masks, single or lowest group, - based on the number of bits: Use to select a particular mask when the - bit position(s) are based on a compile-time variable. Useful for generic - programming. -

            +

            + Templates for the selection of integer masks, single or lowest group, + based on the number of bits: Use to select a particular mask when + the bit position(s) are based on a compile-time variable. Useful + for generic programming. +

            -

            - Compile time log2 Calculation. -

            +

            + Compile time log2 Calculation. +

            -

            - <boost/integer/static_log2.hpp> -

            +

            + <boost/integer/static_log2.hpp> +

            -

            - Template for finding the highest power of two in a number: Use to find - the bit-size/range based on a maximum value. Useful for generic programming. -

            +

            + Template for finding the highest power of two in a number: Use to + find the bit-size/range based on a maximum value. Useful for generic + programming. +

            -

            - Compile time min/max calculation. -

            +

            + Compile time min/max calculation. +

            -

            - <boost/integer/static_min_max.hpp> -

            +

            + <boost/integer/static_min_max.hpp> +

            -

            - Templates for finding the extrema of two numbers: Use to find a bound - based on a minimum or maximum value. Useful for generic programming. -

            +

            + Templates for finding the extrema of two numbers: Use to find a bound + based on a minimum or maximum value. Useful for generic programming. +

            @@ -237,7 +237,7 @@
            - +

            Last revised: December 11, 2009 at 17:54:58 GMT

            Last revised: April 05, 2010 at 07:20:03 GMT


            diff --git a/doc/integer.qbk b/doc/integer.qbk index c5d6e70..8b505dc 100644 --- a/doc/integer.qbk +++ b/doc/integer.qbk @@ -43,7 +43,7 @@ compile-time value; and computing min and max of constant expressions. ] [ [[link boost_integer.integer Integer Type Selection].] - [[^[@../../../../boost/hpp ]]] + [[^[@../../../../boost/integer.hpp ]]] [Templates for integer type selection based on properties such as maximum value or number of bits: Use to select the type of an integer when some property such as maximum value or number of bits is known. Useful for generic programming. ] From e3da9260e1b3c252219e411aba32fd5852671798 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sat, 12 Jun 2010 08:33:32 +0000 Subject: [PATCH 19/31] Merge fixes from Trunk. [SVN r62832] --- include/boost/cstdint.hpp | 43 +++++++++++++++++++++++++++++------ include/boost/integer.hpp | 4 ++++ include/boost/integer_fwd.hpp | 12 +++++++--- 3 files changed, 49 insertions(+), 10 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 47e6a16..ee55e69 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -366,58 +366,87 @@ INT#_C macros if they're not already defined (John Maddock). ******************************************************/ -#if !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(INT8_C) +#if !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && \ + (!defined(INT8_C) || !defined(INT16_C) || !defined(INT32_C) || !defined(INT64_C)) +// +// For the following code we get several warnings along the lines of: +// +// boost/cstdint.hpp:428:35: error: use of C99 long long integer constant +// +// So we declare this a system header to suppress these warnings. +// +#if defined(__GNUC__) && (__GNUC__ >= 4) +#pragma GCC system_header +#endif + #include # define BOOST__STDC_CONSTANT_MACROS_DEFINED # if defined(BOOST_HAS_MS_INT64) // // Borland/Intel/Microsoft compilers have width specific suffixes: // +#ifndef INT8_C # define INT8_C(value) value##i8 +#endif +#ifndef INT16_C # define INT16_C(value) value##i16 +#endif +#ifndef INT32_C # define INT32_C(value) value##i32 +#endif +#ifndef INT64_C # define INT64_C(value) value##i64 +#endif # ifdef __BORLANDC__ // Borland bug: appending ui8 makes the type a signed char # define UINT8_C(value) static_cast(value##u) # else # define UINT8_C(value) value##ui8 # endif +#ifndef UINT16_C # define UINT16_C(value) value##ui16 +#endif +#ifndef UINT32_C # define UINT32_C(value) value##ui32 +#endif +#ifndef UINT64_C # define UINT64_C(value) value##ui64 +#endif +#ifndef INTMAX_C # define INTMAX_C(value) value##i64 # define UINTMAX_C(value) value##ui64 +#endif # else // do it the old fashioned way: // 8-bit types ------------------------------------------------------------// -# if UCHAR_MAX == 0xff +# if (UCHAR_MAX == 0xff) && !defined(INT8_C) # define INT8_C(value) static_cast(value) # define UINT8_C(value) static_cast(value##u) # endif // 16-bit types -----------------------------------------------------------// -# if USHRT_MAX == 0xffff +# if (USHRT_MAX == 0xffff) && !defined(INT16_C) # define INT16_C(value) static_cast(value) # define UINT16_C(value) static_cast(value##u) # endif // 32-bit types -----------------------------------------------------------// - -# if UINT_MAX == 0xffffffff +#ifndef INT32_C +# if (UINT_MAX == 0xffffffff) # define INT32_C(value) value # define UINT32_C(value) value##u # elif ULONG_MAX == 0xffffffff # define INT32_C(value) value##L # define UINT32_C(value) value##uL # endif +#endif // 64-bit types + intmax_t and uintmax_t ----------------------------------// - +#ifndef INT64_C # if defined(BOOST_HAS_LONG_LONG) && \ (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX) || defined(_LLONG_MAX)) @@ -462,7 +491,7 @@ INT#_C macros if they're not already defined (John Maddock). # define INTMAX_C(value) INT64_C(value) # define UINTMAX_C(value) UINT64_C(value) # endif - +#endif # endif // Borland/Microsoft specific width suffixes #endif // INT#_C macros. diff --git a/include/boost/integer.hpp b/include/boost/integer.hpp index 3393c81..fc0b398 100644 --- a/include/boost/integer.hpp +++ b/include/boost/integer.hpp @@ -57,6 +57,8 @@ namespace boost // no specializations for 0 and 5: requests for a type > long are in error #ifdef BOOST_HAS_LONG_LONG template<> struct int_least_helper<1> { typedef boost::long_long_type least; }; +#elif defined(BOOST_HAS_MS_INT64) + template<> struct int_least_helper<1> { typedef __int64 least; }; #endif template<> struct int_least_helper<2> { typedef long least; }; template<> struct int_least_helper<3> { typedef int least; }; @@ -64,6 +66,8 @@ namespace boost template<> struct int_least_helper<5> { typedef signed char least; }; #ifdef BOOST_HAS_LONG_LONG template<> struct int_least_helper<6> { typedef boost::ulong_long_type least; }; +#elif defined(BOOST_HAS_MS_INT64) + template<> struct int_least_helper<6> { typedef unsigned __int64 least; }; #endif template<> struct int_least_helper<7> { typedef unsigned long least; }; template<> struct int_least_helper<8> { typedef unsigned int least; }; diff --git a/include/boost/integer_fwd.hpp b/include/boost/integer_fwd.hpp index 01b0a08..e6045ca 100644 --- a/include/boost/integer_fwd.hpp +++ b/include/boost/integer_fwd.hpp @@ -77,12 +77,18 @@ template < > template < > class integer_traits< unsigned long >; -#if !defined(BOOST_NO_INTEGRAL_INT64_T) && !defined(BOOST_NO_INT64_T) && (defined(BOOST_HAS_LONG_LONG) || defined(BOOST_HAS_MS_INT64)) +#if !defined(BOOST_NO_INTEGRAL_INT64_T) && !defined(BOOST_NO_INT64_T) && defined(BOOST_HAS_LONG_LONG) template < > - class integer_traits< ::boost::long_long_type>; +class integer_traits< ::boost::long_long_type>; template < > - class integer_traits< ::boost::ulong_long_type >; +class integer_traits< ::boost::ulong_long_type >; +#elif !defined(BOOST_NO_INTEGRAL_INT64_T) && !defined(BOOST_NO_INT64_T) && defined(BOOST_HAS_MS_INT64) +template < > +class integer_traits<__int64>; + +template < > +class integer_traits; #endif From f390a648255bd1884944629bb183e0f190a3c3b4 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sat, 26 Jun 2010 12:30:09 +0000 Subject: [PATCH 20/31] Merge documentation fixes. * Use `doc/src/*.css` instead of `doc/html/*.css`. * Remove wiki and people directories. * Some documentation fixes. * Left out `minimal.css` changes and boostbook changes because of clashes. [SVN r63347] --- doc/Jamfile.v2 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index 18c50ae..de1f8a7 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -26,10 +26,6 @@ boostbook standalone generate.section.toc.level=4 # Path for links to Boost: boost.root=../../../.. - # Path for libraries index: - boost.libraries=../../../../libs/libraries.htm - # Use the main Boost stylesheet: - html.stylesheet=../../../../doc/html/boostbook.css # PDF Options: # TOC Generation: this is needed for FOP-0.9 and later: From 245c28d18726dff88dd8565039c8981f69a106b7 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Thu, 8 Jul 2010 22:22:21 +0000 Subject: [PATCH 21/31] Merge integer documentation. [SVN r63767] --- doc/html/boost_integer/cstdint.html | 88 ++++++++++++++++++++--------- doc/html/boost_integer/history.html | 60 ++++++++++---------- doc/html/boost_integer/integer.html | 38 ++++++------- doc/html/boost_integer/log2.html | 30 +++++----- doc/html/boost_integer/mask.html | 26 ++++----- doc/html/boost_integer/minmax.html | 20 +++---- doc/html/boost_integer/traits.html | 18 +++--- doc/html/index.html | 16 +++--- 8 files changed, 164 insertions(+), 132 deletions(-) diff --git a/doc/html/boost_integer/cstdint.html b/doc/html/boost_integer/cstdint.html index b709cfc..151ee51 100644 --- a/doc/html/boost_integer/cstdint.html +++ b/doc/html/boost_integer/cstdint.html @@ -2,7 +2,7 @@ Standard Integer Types - + @@ -20,9 +20,9 @@
            -PrevUpHomeNext +PrevUpHomeNext
            -
            + -
            +
            @@ -62,7 +62,7 @@ a test program.

            -
            +
            @@ -82,7 +82,7 @@ conventions rather than C++ Standard Library header naming conventions.

            -
            +
            @@ -99,7 +99,7 @@ Use the respective names in namespace boost instead.

            -
            +

            Exact-width integer types @@ -119,7 +119,7 @@ The absence of int64_t and uint64_t is indicated by the macro BOOST_NO_INT64_T.

            -
            +

            Minimum-width integer types @@ -138,26 +138,42 @@ The following minimum-width integer types are provided for all platforms:

              -
            • int_least8_t
            • -
            • int_least16_t
            • -
            • int_least32_t
            • -
            • uint_least8_t
            • -
            • uint_least16_t
            • -
            • uint_least32_t
            • +
            • + int_least8_t +
            • +
            • + int_least16_t +
            • +
            • + int_least32_t +
            • +
            • + uint_least8_t +
            • +
            • + uint_least16_t +
            • +
            • + uint_least32_t +

            The following types are available only if, after including <boost/cstdint.hpp>, the macro BOOST_NO_INT64_T is not defined:

              -
            • int_least64_t
            • -
            • uint_least64_t
            • +
            • + int_least64_t +
            • +
            • + uint_least64_t +

            All other minimum-width integer types are optional.

            -
            +

            Fastest minimum-width integer types @@ -176,26 +192,42 @@ The following fastest minimum-width integer types are provided for all platforms:

              -
            • int_fast8_t
            • -
            • int_fast16_t
            • -
            • int_fast32_t
            • -
            • uint_fast8_t
            • -
            • uint_fast16_t
            • -
            • uint_fast32_t
            • +
            • + int_fast8_t +
            • +
            • + int_fast16_t +
            • +
            • + int_fast32_t +
            • +
            • + uint_fast8_t +
            • +
            • + uint_fast16_t +
            • +
            • + uint_fast32_t +

            The following types are available only if, after including <boost/cstdint.hpp>, the macro BOOST_NO_INT64_T is not defined:

              -
            • int_fast64_t
            • -
            • uint_fast64_t
            • +
            • + int_fast64_t +
            • +
            • + uint_fast64_t +

            All other fastest minimum-width integer types are optional.

            -
            +

            Greatest-width integer types @@ -212,7 +244,7 @@ These types are provided for all platforms.

            -
            +

            Integer Constant Macros @@ -251,7 +283,7 @@
            -PrevUpHomeNext +PrevUpHomeNext
            diff --git a/doc/html/boost_integer/history.html b/doc/html/boost_integer/history.html index 3d6cb39..e858c84 100644 --- a/doc/html/boost_integer/history.html +++ b/doc/html/boost_integer/history.html @@ -2,7 +2,7 @@ History - + @@ -19,51 +19,51 @@
            -PrevUpHome +PrevUpHome
            -
            +
            - + 1.42.0
            • - Reverted Trunk to release branch state (i.e. a "known good state"). -
            • + Reverted Trunk to release branch state (i.e. a "known good state"). +
            • - Fixed issues: 653, - 3084, - 3177, - 3180, - 3568, - 3657, - 2134. -
            • + Fixed issues: 653, + 3084, + 3177, + 3180, + 3568, + 3657, + 2134. +
            • - Added long long support to boost::static_log2, boost::static_signed_min, - boost::static_signed_max, boost::static_unsigned_minboost::static_unsigned_max, - when available. -
            • + Added long long support to boost::static_log2, boost::static_signed_min, + boost::static_signed_max, boost::static_unsigned_minboost::static_unsigned_max, + when available. +
            • - The argument type and the result type of boost::static_signed_min - etc are now typedef'd. Formerly, they were hardcoded as unsigned - long and int respectively. Please, use the provided - typedefs in new code (and update old code as soon as possible). -
            • + The argument type and the result type of boost::static_signed_min + etc are now typedef'd. Formerly, they were hardcoded as unsigned + long and int respectively. Please, use the + provided typedefs in new code (and update old code as soon as possible). +
            - + 1.32.0
            • - The argument type and the result type of boost::static_log2 - are now typedef'd. Formerly, they were hardcoded as unsigned long - and int respectively. Please, use the provided typedefs - in new code (and update old code as soon as possible). -
            + The argument type and the result type of boost::static_log2 + are now typedef'd. Formerly, they were hardcoded as unsigned long + and int respectively. Please, use the provided typedefs + in new code (and update old code as soon as possible). +

        @@ -76,7 +76,7 @@

        -PrevUpHome +PrevUpHome
        diff --git a/doc/html/boost_integer/integer.html b/doc/html/boost_integer/integer.html index 4078a26..5f69206 100644 --- a/doc/html/boost_integer/integer.html +++ b/doc/html/boost_integer/integer.html @@ -2,7 +2,7 @@ Integer Type Selection - + @@ -20,9 +20,9 @@
        -PrevUpHomeNext +PrevUpHomeNext
        -
        +
        @@ -44,7 +44,7 @@ characteristics such as number of bits or maximum value. This facility is particularly useful for solving generic programming problems.

        -
        +
        @@ -102,7 +102,7 @@ } // namespace boost
        -
        +

        Easiest-to-Manipulate Types @@ -126,7 +126,7 @@ the input type.

        -
        +
        @@ -341,7 +341,7 @@

        -
        +
        @@ -363,7 +363,7 @@ }
        -
        +

        Demonstration Program @@ -374,7 +374,7 @@ of the sized type class templates.

        -
        +
        @@ -383,18 +383,18 @@

        • - Avoid recursion because of concern about C++'s limited guaranteed recursion - depth (17). -
        • + Avoid recursion because of concern about C++'s limited guaranteed recursion + depth (17). +
        • - Avoid macros on general principles. -
        • + Avoid macros on general principles. +
        • - Try to keep the design as simple as possible. -
        • + Try to keep the design as simple as possible. +
        -
        +
        @@ -403,7 +403,7 @@ to use the types supplied in <boost/cstdint.hpp>.

        -
        +
        @@ -426,7 +426,7 @@
        -PrevUpHomeNext +PrevUpHomeNext
        diff --git a/doc/html/boost_integer/log2.html b/doc/html/boost_integer/log2.html index 44669ae..8204023 100644 --- a/doc/html/boost_integer/log2.html +++ b/doc/html/boost_integer/log2.html @@ -2,7 +2,7 @@ Compile Time log2 Calculation - + @@ -20,9 +20,9 @@
        -PrevUpHomeNext +PrevUpHomeNext
        -
        +
        @@ -39,7 +39,7 @@ determines the position of the highest bit in a given value. This facility is useful for solving generic programming problems.

        -
        +
        @@ -66,7 +66,7 @@ } // namespace boost
        -
        +
        @@ -87,16 +87,16 @@

        • -static_log2_argument_type is an unsigned integer - type (C++ standard, 3.9.1p3). -
        • + static_log2_argument_type is an unsigned + integer type (C++ standard, 3.9.1p3). +
        • -static_log2_result_type is an integer type - (C++ standard, 3.9.1p7). -
        • + static_log2_result_type is an integer type + (C++ standard, 3.9.1p7). +
        -
        +

        Demonstration Program @@ -107,7 +107,7 @@ of the binary logarithm class template.

        -
        +
        @@ -120,7 +120,7 @@ to be available statically (i.e. at compile-time).

        -
        +
        @@ -145,7 +145,7 @@
        -PrevUpHomeNext +PrevUpHomeNext
        diff --git a/doc/html/boost_integer/mask.html b/doc/html/boost_integer/mask.html index ff9972f..068634d 100644 --- a/doc/html/boost_integer/mask.html +++ b/doc/html/boost_integer/mask.html @@ -2,7 +2,7 @@ Integer Masks - + @@ -20,9 +20,9 @@
        -PrevUpHomeNext +PrevUpHomeNext
        -
        +
        @@ -41,7 +41,7 @@
        Rationale
        Credits
        -
        +
        @@ -52,7 +52,7 @@ type selection templates header.

        -
        +
        @@ -90,7 +90,7 @@ } // namespace boost
        -
        +

        Single Bit-Mask Class Template @@ -191,7 +191,7 @@


        -
        +

        Group Bit-Mask Class Template @@ -292,7 +292,7 @@


        -
        +

        Implementation Notes @@ -304,7 +304,7 @@ bit counts.

        -
        +
        @@ -328,7 +328,7 @@ }
        -
        +

        Demonstration Program @@ -339,7 +339,7 @@ of the bit mask class templates.

        -
        +
        @@ -351,7 +351,7 @@ bits. This prevents contamination of values by the higher, unused bits.

        -
        +
        @@ -372,7 +372,7 @@
        -PrevUpHomeNext +PrevUpHomeNext
        diff --git a/doc/html/boost_integer/minmax.html b/doc/html/boost_integer/minmax.html index 7e8d396..8f9b3e2 100644 --- a/doc/html/boost_integer/minmax.html +++ b/doc/html/boost_integer/minmax.html @@ -2,7 +2,7 @@ Compile time min/max calculation - + @@ -20,9 +20,9 @@
        -PrevUpHomeNext +PrevUpHomeNext
        -
        +
        @@ -40,7 +40,7 @@ provide a compile-time evaluation of the minimum or maximum of two integers. These facilities are useful for generic programming problems.

        -
        +
        @@ -65,7 +65,7 @@ }
        -
        +
        @@ -77,7 +77,7 @@ which is set to the respective minimum or maximum of the template's parameters.

        -
        +
        @@ -112,7 +112,7 @@ }
        -
        +

        Demonstration Program @@ -123,7 +123,7 @@ extrema class templates.

        -
        +
        @@ -133,7 +133,7 @@ another class template.

        -
        +
        @@ -154,7 +154,7 @@
        -PrevUpHomeNext +PrevUpHomeNext
        diff --git a/doc/html/boost_integer/traits.html b/doc/html/boost_integer/traits.html index d60fef3..08f8f38 100644 --- a/doc/html/boost_integer/traits.html +++ b/doc/html/boost_integer/traits.html @@ -2,7 +2,7 @@ Integer Traits - + @@ -20,9 +20,9 @@
        -PrevUpHomeNext +PrevUpHomeNext
        -
        + -
        +
        @@ -62,7 +62,7 @@ The template class integer_traits addresses this problem.

        -
        +
        @@ -82,7 +82,7 @@ }
        -
        +
        @@ -179,7 +179,7 @@ unless boost::integer_traits is also specialized.

        -
        +
        @@ -188,7 +188,7 @@ exercises the integer_traits class.

        -
        +
        @@ -209,7 +209,7 @@
        -PrevUpHomeNext +PrevUpHomeNext
        diff --git a/doc/html/index.html b/doc/html/index.html index 1e4d3da..4c106d4 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -2,7 +2,7 @@ Boost.Integer - + @@ -17,8 +17,8 @@ More
        -
        Next
        -
        +
        Next
        +

        @@ -39,8 +39,8 @@

        -
        -

        +

        +

        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)

        @@ -61,7 +61,7 @@
        History
        -
        +
        @@ -237,10 +237,10 @@
        - +

        Last revised: April 05, 2010 at 07:20:03 GMT

        Last revised: July 08, 2010 at 20:45:20 GMT


        -
        Next
        +
        Next
        From 614515a77b3952198580d0c350a6a3c0f5655f7b Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sat, 2 Oct 2010 12:14:04 +0000 Subject: [PATCH 22/31] Fix logic in cstdint to prefer smaller integers when possible. Improve PP-logic in integer-traits. Suppress some compiler warnings. [SVN r65721] --- include/boost/cstdint.hpp | 25 ++++--- include/boost/integer/integer_mask.hpp | 24 +++++++ include/boost/integer_fwd.hpp | 16 ----- test/integer_mask_test.cpp | 92 ++++++++++++++++++++++++-- 4 files changed, 126 insertions(+), 31 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index ee55e69..ea84b65 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -137,7 +137,7 @@ namespace boost } // namespace boost -#elif defined(__FreeBSD__) && (__FreeBSD__ <= 4) || defined(__osf__) +#elif defined(__FreeBSD__) && (__FreeBSD__ <= 4) || defined(__osf__) || defined(__VMS) // FreeBSD and Tru64 have an that contains much of what we need. # include @@ -256,20 +256,27 @@ namespace boost // 32-bit types -----------------------------------------------------------// -# if ULONG_MAX == 0xffffffff - typedef long int32_t; - typedef long int_least32_t; - typedef long int_fast32_t; - typedef unsigned long uint32_t; - typedef unsigned long uint_least32_t; - typedef unsigned long uint_fast32_t; -# elif UINT_MAX == 0xffffffff +# if UINT_MAX == 0xffffffff typedef int int32_t; typedef int int_least32_t; typedef int int_fast32_t; typedef unsigned int uint32_t; typedef unsigned int uint_least32_t; typedef unsigned int uint_fast32_t; +# elif (USHRT_MAX == 0xffffffff) + typedef short int32_t; + typedef short int_least32_t; + typedef short int_fast32_t; + typedef unsigned short uint32_t; + typedef unsigned short uint_least32_t; + typedef unsigned short uint_fast32_t; +# elif ULONG_MAX == 0xffffffff + typedef long int32_t; + typedef long int_least32_t; + typedef long int_fast32_t; + typedef unsigned long uint32_t; + typedef unsigned long uint_least32_t; + typedef unsigned long uint_fast32_t; # elif (UINT_MAX == 0xffffffffffffffff) && defined(__MTA__) // Integers are 64 bits on the MTA / XMT typedef __int32 int32_t; diff --git a/include/boost/integer/integer_mask.hpp b/include/boost/integer/integer_mask.hpp index 8c4e1bb..2acf7f7 100644 --- a/include/boost/integer/integer_mask.hpp +++ b/include/boost/integer/integer_mask.hpp @@ -20,6 +20,17 @@ #include // for std::numeric_limits +// +// We simply cannot include this header on gcc without getting copious warnings of the kind: +// +// boost/integer/integer_mask.hpp:93:35: warning: use of C99 long long integer constant +// +// And yet there is no other reasonable implementation, so we declare this a system header +// to suppress these warnings. +// +#if defined(__GNUC__) && (__GNUC__ >= 4) +#pragma GCC system_header +#endif namespace boost { @@ -89,6 +100,19 @@ BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned int ); BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned long ); #endif +#if defined(BOOST_HAS_LONG_LONG) + #if ((defined(ULLONG_MAX) && (ULLONG_MAX > ULONG_MAX)) ||\ + (defined(ULONG_LONG_MAX) && (ULONG_LONG_MAX > ULONG_MAX)) ||\ + (defined(ULONGLONG_MAX) && (ULONGLONG_MAX > ULONG_MAX)) ||\ + (defined(_ULLONG_MAX) && (_ULLONG_MAX > ULONG_MAX))) + BOOST_LOW_BITS_MASK_SPECIALIZE( boost::ulong_long_type ); + #endif +#elif defined(BOOST_HAS_MS_INT64) + #if 18446744073709551615ui64 > ULONG_MAX + BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned __int64 ); + #endif +#endif + #ifdef BOOST_MSVC #pragma warning(pop) #endif diff --git a/include/boost/integer_fwd.hpp b/include/boost/integer_fwd.hpp index e6045ca..20eff2b 100644 --- a/include/boost/integer_fwd.hpp +++ b/include/boost/integer_fwd.hpp @@ -136,22 +136,6 @@ template < std::size_t Bits > template < > struct low_bits_mask_t< ::std::numeric_limits::digits >; -#if USHRT_MAX > UCHAR_MAX -template < > - struct low_bits_mask_t< ::std::numeric_limits::digits >; -#endif - -#if UINT_MAX > USHRT_MAX -template < > - struct low_bits_mask_t< ::std::numeric_limits::digits >; -#endif - -#if ULONG_MAX > UINT_MAX -template < > - struct low_bits_mask_t< ::std::numeric_limits::digits >; -#endif - - // From ------------------------------------// template diff --git a/test/integer_mask_test.cpp b/test/integer_mask_test.cpp index 4c1bb4b..a66ab8d 100644 --- a/test/integer_mask_test.cpp +++ b/test/integer_mask_test.cpp @@ -21,25 +21,35 @@ #pragma warning(disable:4127) // conditional expression is constant #endif +#if defined(BOOST_HAS_LONG_LONG) +#define MASK_TYPE ::boost::ulong_long_type +#elif defined(BOOST_HAS_MS_INT64) +#define MASK_TYPE unsigned __int64 +#else +#define MASK_TYPE unsigned long +#endif + +#define ONE (static_cast(1)) + #define PRIVATE_HIGH_BIT_SLOW_TEST(v) BOOST_TEST( ::boost::high_bit_mask_t< \ - (v) >::high_bit == (1ul << (v)) ); + (v) >::high_bit == (ONE << (v)) ); #define PRIVATE_HIGH_BIT_FAST_TEST(v) BOOST_TEST( ::boost::high_bit_mask_t< \ - (v) >::high_bit_fast == (1ul << (v)) ); + (v) >::high_bit_fast == (ONE << (v)) ); #define PRIVATE_HIGH_BIT_TEST(v) do { PRIVATE_HIGH_BIT_SLOW_TEST(v); \ PRIVATE_HIGH_BIT_FAST_TEST(v); } while (false) #define PRIVATE_LOW_BITS_SLOW_TEST(v) \ do{ \ - unsigned long mask = 0;\ + MASK_TYPE mask = 0;\ if(v > 0)\ - { mask = ((1ul << (v-1)) - 1); mask <<= 1; mask |= 1; }\ + { mask = ((ONE << (v-1)) - 1); mask <<= 1; mask |= 1; }\ BOOST_TEST( ::boost::low_bits_mask_t< (v) >::sig_bits == mask); \ }while(false); #define PRIVATE_LOW_BITS_FAST_TEST(v) \ do{ \ - unsigned long mask = 0;\ + MASK_TYPE mask = 0;\ if(v > 0)\ - { mask = ((1ul << (v-1)) - 1); mask <<= 1; mask |= 1; }\ + { mask = ((ONE << (v-1)) - 1); mask <<= 1; mask |= 1; }\ BOOST_TEST( ::boost::low_bits_mask_t< (v) >::sig_bits_fast == mask);\ }while(false); #define PRIVATE_LOW_BITS_TEST(v) do { PRIVATE_LOW_BITS_SLOW_TEST(v); \ @@ -52,6 +62,41 @@ int main( int, char*[] ) using std::endl; cout << "Doing high_bit_mask_t tests." << endl; + +#if defined(BOOST_HAS_LONG_LONG) || defined(BOOST_HAS_MS_INT64) + PRIVATE_HIGH_BIT_TEST( 63 ); + PRIVATE_HIGH_BIT_TEST( 62 ); + PRIVATE_HIGH_BIT_TEST( 61 ); + PRIVATE_HIGH_BIT_TEST( 60 ); + PRIVATE_HIGH_BIT_TEST( 59 ); + PRIVATE_HIGH_BIT_TEST( 58 ); + PRIVATE_HIGH_BIT_TEST( 57 ); + PRIVATE_HIGH_BIT_TEST( 56 ); + PRIVATE_HIGH_BIT_TEST( 55 ); + PRIVATE_HIGH_BIT_TEST( 54 ); + PRIVATE_HIGH_BIT_TEST( 53 ); + PRIVATE_HIGH_BIT_TEST( 52 ); + PRIVATE_HIGH_BIT_TEST( 51 ); + PRIVATE_HIGH_BIT_TEST( 50 ); + PRIVATE_HIGH_BIT_TEST( 49 ); + PRIVATE_HIGH_BIT_TEST( 48 ); + PRIVATE_HIGH_BIT_TEST( 47 ); + PRIVATE_HIGH_BIT_TEST( 46 ); + PRIVATE_HIGH_BIT_TEST( 45 ); + PRIVATE_HIGH_BIT_TEST( 44 ); + PRIVATE_HIGH_BIT_TEST( 43 ); + PRIVATE_HIGH_BIT_TEST( 42 ); + PRIVATE_HIGH_BIT_TEST( 41 ); + PRIVATE_HIGH_BIT_TEST( 40 ); + PRIVATE_HIGH_BIT_TEST( 39 ); + PRIVATE_HIGH_BIT_TEST( 38 ); + PRIVATE_HIGH_BIT_TEST( 37 ); + PRIVATE_HIGH_BIT_TEST( 36 ); + PRIVATE_HIGH_BIT_TEST( 35 ); + PRIVATE_HIGH_BIT_TEST( 34 ); + PRIVATE_HIGH_BIT_TEST( 33 ); + PRIVATE_HIGH_BIT_TEST( 32 ); +#endif PRIVATE_HIGH_BIT_TEST( 31 ); PRIVATE_HIGH_BIT_TEST( 30 ); PRIVATE_HIGH_BIT_TEST( 29 ); @@ -86,6 +131,41 @@ int main( int, char*[] ) PRIVATE_HIGH_BIT_TEST( 0 ); cout << "Doing low_bits_mask_t tests." << endl; + +#if defined(BOOST_HAS_LONG_LONG) || defined(BOOST_HAS_MS_INT64) + PRIVATE_LOW_BITS_TEST( 64 ); + PRIVATE_LOW_BITS_TEST( 63 ); + PRIVATE_LOW_BITS_TEST( 62 ); + PRIVATE_LOW_BITS_TEST( 61 ); + PRIVATE_LOW_BITS_TEST( 60 ); + PRIVATE_LOW_BITS_TEST( 59 ); + PRIVATE_LOW_BITS_TEST( 58 ); + PRIVATE_LOW_BITS_TEST( 57 ); + PRIVATE_LOW_BITS_TEST( 56 ); + PRIVATE_LOW_BITS_TEST( 55 ); + PRIVATE_LOW_BITS_TEST( 54 ); + PRIVATE_LOW_BITS_TEST( 53 ); + PRIVATE_LOW_BITS_TEST( 52 ); + PRIVATE_LOW_BITS_TEST( 51 ); + PRIVATE_LOW_BITS_TEST( 50 ); + PRIVATE_LOW_BITS_TEST( 49 ); + PRIVATE_LOW_BITS_TEST( 48 ); + PRIVATE_LOW_BITS_TEST( 47 ); + PRIVATE_LOW_BITS_TEST( 46 ); + PRIVATE_LOW_BITS_TEST( 45 ); + PRIVATE_LOW_BITS_TEST( 44 ); + PRIVATE_LOW_BITS_TEST( 43 ); + PRIVATE_LOW_BITS_TEST( 42 ); + PRIVATE_LOW_BITS_TEST( 41 ); + PRIVATE_LOW_BITS_TEST( 40 ); + PRIVATE_LOW_BITS_TEST( 39 ); + PRIVATE_LOW_BITS_TEST( 38 ); + PRIVATE_LOW_BITS_TEST( 37 ); + PRIVATE_LOW_BITS_TEST( 36 ); + PRIVATE_LOW_BITS_TEST( 35 ); + PRIVATE_LOW_BITS_TEST( 34 ); + PRIVATE_LOW_BITS_TEST( 33 ); +#endif PRIVATE_LOW_BITS_TEST( 32 ); PRIVATE_LOW_BITS_TEST( 31 ); PRIVATE_LOW_BITS_TEST( 30 ); From 24785bf9976dfd3b5667383d8997230162a106bb Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Thu, 31 Mar 2011 21:41:11 +0000 Subject: [PATCH 23/31] Merge [68802] from the trunk. [SVN r70799] --- include/boost/integer_traits.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/integer_traits.hpp b/include/boost/integer_traits.hpp index 34b3570..e31a638 100644 --- a/include/boost/integer_traits.hpp +++ b/include/boost/integer_traits.hpp @@ -227,7 +227,7 @@ class integer_traits< ::boost::ulong_long_type> template<> class integer_traits< ::boost::long_long_type> : public std::numeric_limits< ::boost::long_long_type>, - public detail::integer_traits_base< ::boost::long_long_type, (1LL << (sizeof(::boost::long_long_type) - 1)), ~(1LL << (sizeof(::boost::long_long_type) - 1))> + public detail::integer_traits_base< ::boost::long_long_type, (1LL << (sizeof(::boost::long_long_type) * CHAR_BIT - 1)), ~(1LL << (sizeof(::boost::long_long_type) * CHAR_BIT - 1))> { }; template<> From 2f6544e54d29936a1a3d90610559b97bdd0b75c9 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 26 Dec 2011 18:08:51 +0000 Subject: [PATCH 24/31] Merge typo fixes from Trunk. [SVN r76190] --- test/integer_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integer_test.cpp b/test/integer_test.cpp index bef0308..fd9e6df 100644 --- a/test/integer_test.cpp +++ b/test/integer_test.cpp @@ -152,7 +152,7 @@ void do_test_bits() if(boost::detail::test_errors() != last_error_count) { last_error_count = boost::detail::test_errors(); - std::cout << "Errors occured while testing with bit count = " << Bits << std::endl; + std::cout << "Errors occurred while testing with bit count = " << Bits << std::endl; std::cout << "Type int_t<" << Bits << ">::least was " << get_name_of_type(least_int(0)) << std::endl; std::cout << "Type int_t<" << Bits << ">::fast was " << get_name_of_type(fast_int(0)) << std::endl; std::cout << "Type uint_t<" << Bits << ">::least was " << get_name_of_type(least_uint(0)) << std::endl; From d12ea4e3016bd6da7410022d8be8851fa356e07e Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 14 May 2012 15:57:59 +0000 Subject: [PATCH 25/31] Merge minor integer fixes from Trunk. [SVN r78469] --- include/boost/integer.hpp | 34 +++++++++++++++++++--------------- test/Jamfile.v2 | 6 ++++++ test/fail_int_exact.cpp | 8 ++++++++ test/fail_int_fast.cpp | 8 ++++++++ test/fail_int_least.cpp | 8 ++++++++ test/fail_uint_exact.cpp | 8 ++++++++ test/fail_uint_fast.cpp | 8 ++++++++ test/fail_uint_least.cpp | 8 ++++++++ 8 files changed, 73 insertions(+), 15 deletions(-) create mode 100644 test/fail_int_exact.cpp create mode 100644 test/fail_int_fast.cpp create mode 100644 test/fail_int_least.cpp create mode 100644 test/fail_uint_exact.cpp create mode 100644 test/fail_uint_fast.cpp create mode 100644 test/fail_uint_least.cpp diff --git a/include/boost/integer.hpp b/include/boost/integer.hpp index fc0b398..35a1e10 100644 --- a/include/boost/integer.hpp +++ b/include/boost/integer.hpp @@ -20,6 +20,7 @@ #include // for boost::::boost::integer_traits #include // for ::std::numeric_limits #include // for boost::int64_t and BOOST_NO_INTEGRAL_INT64_T +#include // // We simply cannot include this header on gcc without getting copious warnings of the kind: @@ -51,6 +52,7 @@ namespace boost // convert category to type 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, // 6=unsigned long, 7=unsigned int, 8=unsigned short, 9=unsigned char @@ -65,14 +67,14 @@ namespace boost template<> struct int_least_helper<4> { typedef short least; }; template<> struct int_least_helper<5> { typedef signed char least; }; #ifdef BOOST_HAS_LONG_LONG - template<> struct int_least_helper<6> { typedef boost::ulong_long_type least; }; + template<> struct uint_least_helper<1> { typedef boost::ulong_long_type least; }; #elif defined(BOOST_HAS_MS_INT64) - template<> struct int_least_helper<6> { typedef unsigned __int64 least; }; + template<> struct uint_least_helper<1> { typedef unsigned __int64 least; }; #endif - template<> struct int_least_helper<7> { typedef unsigned long least; }; - template<> struct int_least_helper<8> { typedef unsigned int least; }; - template<> struct int_least_helper<9> { typedef unsigned short least; }; - template<> struct int_least_helper<10> { typedef unsigned char least; }; + template<> struct uint_least_helper<2> { typedef unsigned long least; }; + template<> struct uint_least_helper<3> { typedef unsigned int least; }; + template<> struct uint_least_helper<4> { typedef unsigned short least; }; + template<> struct uint_least_helper<5> { typedef unsigned char least; }; template struct exact_signed_base_helper{}; @@ -111,10 +113,12 @@ namespace boost template< int Bits > // bits (including sign) required struct int_t : public detail::exact_signed_base_helper { + 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 < #ifdef BOOST_HAS_LONG_LONG - (Bits-1 <= (int)(sizeof(boost::long_long_type) * CHAR_BIT)) + + (Bits <= (int)(sizeof(boost::long_long_type) * CHAR_BIT)) + #else 1 + #endif @@ -130,6 +134,8 @@ namespace boost template< int Bits > // bits required struct uint_t : public detail::exact_unsigned_base_helper { + 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 = @@ -140,11 +146,10 @@ namespace boost (Bits <= ::std::numeric_limits::digits)); typedef typename detail::int_least_helper< ::boost::uint_t::s>::least least; #else - typedef typename detail::int_least_helper + typedef typename detail::uint_least_helper < - 5 + #ifdef BOOST_HAS_LONG_LONG - (Bits-1 <= (int)(sizeof(boost::long_long_type) * CHAR_BIT)) + + (Bits <= (int)(sizeof(boost::long_long_type) * CHAR_BIT)) + #else 1 + #endif @@ -217,7 +222,7 @@ namespace boost // 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 = - 6 + + 1 + (MaxValue <= ::boost::integer_traits::const_max) + (MaxValue <= ::boost::integer_traits::const_max) + (MaxValue <= ::boost::integer_traits::const_max) + @@ -225,18 +230,17 @@ namespace boost typedef typename detail::int_least_helper< ::boost::uint_value_t::which>::least least; #else // BOOST_NO_INTEGRAL_INT64_T BOOST_STATIC_CONSTANT(unsigned, which = - 5 + + 1 + (MaxValue <= ::boost::integer_traits::const_max) + (MaxValue <= ::boost::integer_traits::const_max) + (MaxValue <= ::boost::integer_traits::const_max) + (MaxValue <= ::boost::integer_traits::const_max) + (MaxValue <= ::boost::integer_traits::const_max)); - typedef typename detail::int_least_helper< ::boost::uint_value_t::which>::least least; + typedef typename detail::uint_least_helper< ::boost::uint_value_t::which>::least least; #endif // BOOST_NO_INTEGRAL_INT64_T #else - typedef typename detail::int_least_helper + typedef typename detail::uint_least_helper < - 5 + #if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) (MaxValue <= ::boost::integer_traits::const_max) + #else diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 690befa..0f58345 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -22,4 +22,10 @@ test-suite integer [ compile static_log2_include_test.cpp ] [ compile static_min_max_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 ] ; diff --git a/test/fail_int_exact.cpp b/test/fail_int_exact.cpp new file mode 100644 index 0000000..1b6e66a --- /dev/null +++ b/test/fail_int_exact.cpp @@ -0,0 +1,8 @@ +// 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 + +typedef boost::int_t::exact fail_int_exact; diff --git a/test/fail_int_fast.cpp b/test/fail_int_fast.cpp new file mode 100644 index 0000000..8e65b7c --- /dev/null +++ b/test/fail_int_fast.cpp @@ -0,0 +1,8 @@ +// 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 + +typedef boost::int_t::fast fail_int_fast; diff --git a/test/fail_int_least.cpp b/test/fail_int_least.cpp new file mode 100644 index 0000000..d06ce6d --- /dev/null +++ b/test/fail_int_least.cpp @@ -0,0 +1,8 @@ +// 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 + +typedef boost::int_t::least fail_int_least; diff --git a/test/fail_uint_exact.cpp b/test/fail_uint_exact.cpp new file mode 100644 index 0000000..36f8628 --- /dev/null +++ b/test/fail_uint_exact.cpp @@ -0,0 +1,8 @@ +// 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 + +typedef boost::uint_t::exact fail_uint_exact; diff --git a/test/fail_uint_fast.cpp b/test/fail_uint_fast.cpp new file mode 100644 index 0000000..99f92b2 --- /dev/null +++ b/test/fail_uint_fast.cpp @@ -0,0 +1,8 @@ +// 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 + +typedef boost::uint_t::fast fail_uint_fast; diff --git a/test/fail_uint_least.cpp b/test/fail_uint_least.cpp new file mode 100644 index 0000000..8cdfbaf --- /dev/null +++ b/test/fail_uint_least.cpp @@ -0,0 +1,8 @@ +// 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 + +typedef boost::uint_t::least fail_uint_least; From 590f9819f910c425bb3ec5db020c0a5a30d9cd55 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sat, 14 Jul 2012 16:05:50 +0000 Subject: [PATCH 26/31] Merge changes from trunk: Fix PDF install rule so that it's explicit and automatically invokes a PDF build when specified on the command line. So "bjam pdfinstall" will now build and install the PDF to the current directory. This works around some problems that the previous versions had if the user did not have an FO processor installed (basically Daniel James was unable to build the HTML docs for the distribution if the pdfinstall rule was implicit). [SVN r79500] --- doc/Jamfile.v2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index de1f8a7..92609ff 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -50,6 +50,7 @@ boostbook standalone pdf:boost.url.prefix=http://www.boost.org/doc/libs/release/libs/regex/doc/html ; -install pdf-install : standalone : . PDF ; +install pdfinstall : standalone/pdf : . PDF ; +explicit pdfinstall ; From 06c28356cc23b9886dd6e9be1a569ef5313a3b18 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Sat, 20 Jul 2013 17:17:10 +0000 Subject: [PATCH 27/31] Merged recent changes from trunk. [SVN r85088] --- include/boost/cstdint.hpp | 217 ++++++++++++++++++++++---------------- 1 file changed, 127 insertions(+), 90 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index ea84b65..98faeae 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -1,8 +1,8 @@ // boost cstdint.hpp header file ------------------------------------------// -// (C) Copyright Beman Dawes 1999. -// (C) Copyright Jens Mauer 2001 -// (C) Copyright John Maddock 2001 +// (C) Copyright Beman Dawes 1999. +// (C) Copyright Jens Mauer 2001 +// (C) Copyright John Maddock 2001 // 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) @@ -24,9 +24,9 @@ #define BOOST_CSTDINT_HPP // -// Since we always define the INT#_C macros as per C++0x, +// Since we always define the INT#_C macros as per C++0x, // define __STDC_CONSTANT_MACROS so that does the right -// thing if possible, and so that the user knows that the macros +// thing if possible, and so that the user knows that the macros // are actually defined as per C99. // #ifndef __STDC_CONSTANT_MACROS @@ -41,7 +41,10 @@ // so we disable use of stdint.h when GLIBC does not define __GLIBC_HAVE_LONG_LONG. // See https://svn.boost.org/trac/boost/ticket/3548 and http://sources.redhat.com/bugzilla/show_bug.cgi?id=10990 // -#if defined(BOOST_HAS_STDINT_H) && (!defined(__GLIBC__) || defined(__GLIBC_HAVE_LONG_LONG)) +#if defined(BOOST_HAS_STDINT_H) \ + && (!defined(__GLIBC__) \ + || defined(__GLIBC_HAVE_LONG_LONG) \ + || (defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 17))))) // The following #include is an implementation artifact; not part of interface. # ifdef __hpux @@ -50,7 +53,7 @@ # ifdef __STDC_32_MODE__ // this is triggered with GCC, because it defines __cplusplus < 199707L # define BOOST_NO_INT64_T -# endif +# endif # elif defined(__FreeBSD__) || defined(__IBMCPP__) || defined(_AIX) # include # else @@ -100,40 +103,40 @@ typedef ::uintfast64_t uint_fast64_t; namespace boost { - using ::int8_t; - using ::int_least8_t; - using ::int_fast8_t; - using ::uint8_t; - using ::uint_least8_t; - using ::uint_fast8_t; - - using ::int16_t; - using ::int_least16_t; - using ::int_fast16_t; - using ::uint16_t; - using ::uint_least16_t; - using ::uint_fast16_t; - - using ::int32_t; - using ::int_least32_t; - using ::int_fast32_t; - using ::uint32_t; - using ::uint_least32_t; - using ::uint_fast32_t; - + using ::int8_t; + using ::int_least8_t; + using ::int_fast8_t; + using ::uint8_t; + using ::uint_least8_t; + using ::uint_fast8_t; + + using ::int16_t; + using ::int_least16_t; + using ::int_fast16_t; + using ::uint16_t; + using ::uint_least16_t; + using ::uint_fast16_t; + + using ::int32_t; + using ::int_least32_t; + using ::int_fast32_t; + using ::uint32_t; + using ::uint_least32_t; + using ::uint_fast32_t; + # ifndef BOOST_NO_INT64_T - using ::int64_t; - using ::int_least64_t; - using ::int_fast64_t; - using ::uint64_t; - using ::uint_least64_t; - using ::uint_fast64_t; - + using ::int64_t; + using ::int_least64_t; + using ::int_fast64_t; + using ::uint64_t; + using ::uint_least64_t; + using ::uint_fast64_t; + # endif - using ::intmax_t; - using ::uintmax_t; + using ::intmax_t; + using ::uintmax_t; } // namespace boost @@ -143,35 +146,35 @@ namespace boost namespace boost { - using ::int8_t; - typedef int8_t int_least8_t; - typedef int8_t int_fast8_t; - using ::uint8_t; - typedef uint8_t uint_least8_t; - typedef uint8_t uint_fast8_t; - - using ::int16_t; - typedef int16_t int_least16_t; - typedef int16_t int_fast16_t; - using ::uint16_t; - typedef uint16_t uint_least16_t; - typedef uint16_t uint_fast16_t; - - using ::int32_t; - typedef int32_t int_least32_t; - typedef int32_t int_fast32_t; - using ::uint32_t; - typedef uint32_t uint_least32_t; - typedef uint32_t uint_fast32_t; - -# ifndef BOOST_NO_INT64_T + using ::int8_t; + typedef int8_t int_least8_t; + typedef int8_t int_fast8_t; + using ::uint8_t; + typedef uint8_t uint_least8_t; + typedef uint8_t uint_fast8_t; - using ::int64_t; - typedef int64_t int_least64_t; - typedef int64_t int_fast64_t; - using ::uint64_t; - typedef uint64_t uint_least64_t; - typedef uint64_t uint_fast64_t; + using ::int16_t; + typedef int16_t int_least16_t; + typedef int16_t int_fast16_t; + using ::uint16_t; + typedef uint16_t uint_least16_t; + typedef uint16_t uint_fast16_t; + + using ::int32_t; + typedef int32_t int_least32_t; + typedef int32_t int_fast32_t; + using ::uint32_t; + typedef uint32_t uint_least32_t; + typedef uint32_t uint_fast32_t; + +# ifndef BOOST_NO_INT64_T + + using ::int64_t; + typedef int64_t int_least64_t; + typedef int64_t int_fast64_t; + using ::uint64_t; + typedef uint64_t uint_least64_t; + typedef uint64_t uint_fast64_t; typedef int64_t intmax_t; typedef uint64_t uintmax_t; @@ -235,15 +238,15 @@ namespace boost typedef unsigned short uint_least16_t; typedef unsigned short uint_fast16_t; # endif -# elif (USHRT_MAX == 0xffffffff) && defined(__MTA__) - // On MTA / XMT short is 32 bits unless the -short16 compiler flag is specified - // MTA / XMT does support the following non-standard integer types - typedef __short16 int16_t; - typedef __short16 int_least16_t; - typedef __short16 int_fast16_t; - typedef unsigned __short16 uint16_t; - typedef unsigned __short16 uint_least16_t; - typedef unsigned __short16 uint_fast16_t; +# elif (USHRT_MAX == 0xffffffff) && defined(__MTA__) + // On MTA / XMT short is 32 bits unless the -short16 compiler flag is specified + // MTA / XMT does support the following non-standard integer types + typedef __short16 int16_t; + typedef __short16 int_least16_t; + typedef __short16 int_fast16_t; + typedef unsigned __short16 uint16_t; + typedef unsigned __short16 uint_least16_t; + typedef unsigned __short16 uint_fast16_t; # elif (USHRT_MAX == 0xffffffff) && defined(CRAY) // no 16-bit types on Cray: typedef short int_least16_t; @@ -277,14 +280,14 @@ namespace boost typedef unsigned long uint32_t; typedef unsigned long uint_least32_t; typedef unsigned long uint_fast32_t; -# elif (UINT_MAX == 0xffffffffffffffff) && defined(__MTA__) - // Integers are 64 bits on the MTA / XMT - typedef __int32 int32_t; - typedef __int32 int_least32_t; - typedef __int32 int_fast32_t; - typedef unsigned __int32 uint32_t; - typedef unsigned __int32 uint_least32_t; - typedef unsigned __int32 uint_fast32_t; +# elif (UINT_MAX == 0xffffffffffffffff) && defined(__MTA__) + // Integers are 64 bits on the MTA / XMT + typedef __int32 int32_t; + typedef __int32 int_least32_t; + typedef __int32 int_fast32_t; + typedef unsigned __int32 uint32_t; + typedef unsigned __int32 uint_least32_t; + typedef unsigned __int32 uint_fast32_t; # else # error defaults not correct; you must hand modify boost/cstdint.hpp # endif @@ -358,6 +361,40 @@ namespace boost #endif // BOOST_HAS_STDINT_H +// intptr_t/uintptr_t are defined separately because they are optional and not universally available +#if defined(BOOST_WINDOWS) && !defined(_WIN32_WCE) && !defined(BOOST_HAS_STDINT_H) +// Older MSVC don't have stdint.h and have intptr_t/uintptr_t defined in stddef.h +#include +#endif + +// PGI seems to not support intptr_t/uintptr_t properly. BOOST_HAS_STDINT_H is not defined for this compiler by Boost.Config. +#if !defined(__PGIC__) + +#if (defined(BOOST_WINDOWS) && !defined(_WIN32_WCE)) \ + || (defined(_XOPEN_UNIX) && (_XOPEN_UNIX+0 > 0) && !defined(__UCLIBC__)) \ + || defined(__CYGWIN__) \ + || defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) \ + || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) + +namespace boost { + using ::intptr_t; + using ::uintptr_t; +} +#define BOOST_HAS_INTPTR_T + +// Clang pretends to be GCC, so it'll match this condition +#elif defined(__GNUC__) && defined(__INTPTR_TYPE__) && defined(__UINTPTR_TYPE__) + +namespace boost { + typedef __INTPTR_TYPE__ intptr_t; + typedef __UINTPTR_TYPE__ uintptr_t; +} +#define BOOST_HAS_INTPTR_T + +#endif + +#endif // !defined(__PGIC__) + #endif // BOOST_CSTDINT_HPP @@ -376,15 +413,15 @@ INT#_C macros if they're not already defined (John Maddock). #if !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && \ (!defined(INT8_C) || !defined(INT16_C) || !defined(INT32_C) || !defined(INT64_C)) // -// For the following code we get several warnings along the lines of: -// -// boost/cstdint.hpp:428:35: error: use of C99 long long integer constant -// -// So we declare this a system header to suppress these warnings. +// For the following code we get several warnings along the lines of: // -#if defined(__GNUC__) && (__GNUC__ >= 4) -#pragma GCC system_header -#endif +// boost/cstdint.hpp:428:35: error: use of C99 long long integer constant +// +// So we declare this a system header to suppress these warnings. +// +#if defined(__GNUC__) && (__GNUC__ >= 4) +#pragma GCC system_header +#endif #include # define BOOST__STDC_CONSTANT_MACROS_DEFINED From 1fd7a3080ade6b5b5f28c776b9c70a1016da48c4 Mon Sep 17 00:00:00 2001 From: Gennaro Prota Date: Sun, 18 Apr 2004 09:15:08 +0000 Subject: [PATCH 28/31] new file (needed by dynamic_bitset) [SVN r22651] --- include/boost/pending/integer_log2.hpp | 96 ++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 include/boost/pending/integer_log2.hpp diff --git a/include/boost/pending/integer_log2.hpp b/include/boost/pending/integer_log2.hpp new file mode 100644 index 0000000..49b97a2 --- /dev/null +++ b/include/boost/pending/integer_log2.hpp @@ -0,0 +1,96 @@ +// ------------------------------------- +// integer_log2.hpp +// +// Gives the integer part of the logarithm, in base 2, of a +// given number. Behavior is undefined if the argument is <= 0. +// +// +// (C) Copyright Gennaro Prota 2003 - 2004. +// +// 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) +// +// ------------------------------------------------------ + + + +#ifndef BOOST_INTEGER_LOG2_HPP_GP_20030301 +#define BOOST_INTEGER_LOG2_HPP_GP_20030301 + +#include +#include "boost/limits.hpp" +#include "boost/config.hpp" + + +namespace boost { + namespace detail { + + template + int integer_log2_impl(T x, int n) { + + int result = 0; + + while (x != 1) { + + const T t = x >> n; + if (t) { + result += n; + x = t; + } + n /= 2; + + } + + return result; + } + + + + // helper to find the maximum power of two + // less than p (more involved than necessary, + // to avoid PTS) + // + template + struct max_pow2_less { + + enum { c = 2*n < p }; + + BOOST_STATIC_CONSTANT(int, value = + c ? (max_pow2_less< c*p, 2*c*n>::value) : n); + + }; + + template <> + struct max_pow2_less<0, 0> { + + BOOST_STATIC_CONSTANT(int, value = 0); + }; + + } // detail + + + // --------- + // integer_log2 + // --------------- + // + template + int integer_log2(T x) { + + assert(x > 0); + + const int n = detail::max_pow2_less< + std::numeric_limits :: digits, 4 + > :: value; + + return detail::integer_log2_impl(x, n); + + } + + + +} + + + +#endif // include guard From 10e19f0e3ed849cf6a055e22b8e57dac785e7735 Mon Sep 17 00:00:00 2001 From: Gennaro Prota Date: Sun, 9 May 2004 08:58:03 +0000 Subject: [PATCH 29/31] added Borland workaround [SVN r22770] --- include/boost/pending/integer_log2.hpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/include/boost/pending/integer_log2.hpp b/include/boost/pending/integer_log2.hpp index 49b97a2..fd8e446 100644 --- a/include/boost/pending/integer_log2.hpp +++ b/include/boost/pending/integer_log2.hpp @@ -19,6 +19,7 @@ #define BOOST_INTEGER_LOG2_HPP_GP_20030301 #include +#include // actually used for Borland only #include "boost/limits.hpp" #include "boost/config.hpp" @@ -67,6 +68,22 @@ namespace boost { BOOST_STATIC_CONSTANT(int, value = 0); }; + // this template is here just for Borland :( + // we could simply rely on numeric_limits but sometimes + // Borland tries to use numeric_limits, because + // of its usual const-related problems in argument deduction + // - gps + template + struct width { + +#ifdef __BORLANDC__ + BOOST_STATIC_CONSTANT(int, value = sizeof(T) * CHAR_BIT); +#else + BOOST_STATIC_CONSTANT(int, value = (std::numeric_limits::digits)); +#endif + + }; + } // detail @@ -80,8 +97,8 @@ namespace boost { assert(x > 0); const int n = detail::max_pow2_less< - std::numeric_limits :: digits, 4 - > :: value; + detail::width :: value, 4 + > :: value; return detail::integer_log2_impl(x, n); From 0f7eb589da1ecc9ad51aa5647853014829b0ffcc Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Sun, 25 Nov 2007 18:07:19 +0000 Subject: [PATCH 30/31] Full merge from trunk at revision 41356 of entire boost-root tree. [SVN r41369] --- include/boost/pending/integer_log2.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/boost/pending/integer_log2.hpp b/include/boost/pending/integer_log2.hpp index fd8e446..15fd8b5 100644 --- a/include/boost/pending/integer_log2.hpp +++ b/include/boost/pending/integer_log2.hpp @@ -12,14 +12,17 @@ // http://www.boost.org/LICENSE_1_0.txt) // // ------------------------------------------------------ - +// +// $Id$ #ifndef BOOST_INTEGER_LOG2_HPP_GP_20030301 #define BOOST_INTEGER_LOG2_HPP_GP_20030301 -#include -#include // actually used for Borland only +#include +#ifdef __BORLANDC__ +#include +#endif #include "boost/limits.hpp" #include "boost/config.hpp" From 914b45976363a343a7414117824116f91bc87045 Mon Sep 17 00:00:00 2001 From: Gennaro Prota Date: Sun, 24 Aug 2008 18:16:24 +0000 Subject: [PATCH 31/31] boost/pending/: ported revision 48251 ("integer_log2.hpp and lowest_bit.hpp, in boost/pending/: little comment cleanup (svn anchors, etc.); added a static_cast<> to silence (harmless) MSVC++ warnings") from trunk [SVN r48353] --- include/boost/pending/integer_log2.hpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/include/boost/pending/integer_log2.hpp b/include/boost/pending/integer_log2.hpp index 15fd8b5..f4bc846 100644 --- a/include/boost/pending/integer_log2.hpp +++ b/include/boost/pending/integer_log2.hpp @@ -1,20 +1,16 @@ -// ------------------------------------- +// ----------------------------------------------------------- // integer_log2.hpp // // Gives the integer part of the logarithm, in base 2, of a // given number. Behavior is undefined if the argument is <= 0. // -// -// (C) Copyright Gennaro Prota 2003 - 2004. +// Copyright (c) 2003-2004, 2008 Gennaro Prota // // 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) // -// ------------------------------------------------------ -// -// $Id$ - +// ----------------------------------------------------------- #ifndef BOOST_INTEGER_LOG2_HPP_GP_20030301 #define BOOST_INTEGER_LOG2_HPP_GP_20030301 @@ -37,7 +33,7 @@ namespace boost { while (x != 1) { - const T t = x >> n; + const T t = static_cast(x >> n); if (t) { result += n; x = t;