Boost logo

Boost-Commit :

From: gennaro.prota_at_[hidden]
Date: 2008-08-31 07:53:46


Author: gennaro_prota
Date: 2008-08-31 07:53:45 EDT (Sun, 31 Aug 2008)
New Revision: 48496
URL: http://svn.boost.org/trac/boost/changeset/48496

Log:
dynamic_bitset:
    * added user-declared default constructor to value_to_type<bool> (yeah, the
      usual "initializing a const instance of an empty class" problem, which
      also affected S. Meyers' null)
    * explicitly qualified occurrence of "bits_per_block" in count() member
      function, to let gcc 3.4.x understand that it *is* a constant expression
    * fixed namespace qualification for vector_max_size_workaround (should've
      been done in the previous commit, sorry)

Text files modified:
   trunk/boost/detail/dynamic_bitset.hpp | 1 +
   trunk/boost/dynamic_bitset/dynamic_bitset.hpp | 10 ++++++++--
   2 files changed, 9 insertions(+), 2 deletions(-)

Modified: trunk/boost/detail/dynamic_bitset.hpp
==============================================================================
--- trunk/boost/detail/dynamic_bitset.hpp (original)
+++ trunk/boost/detail/dynamic_bitset.hpp 2008-08-31 07:53:45 EDT (Sun, 31 Aug 2008)
@@ -62,6 +62,7 @@
     template <bool value>
     struct value_to_type
     {
+ value_to_type() {}
     };
     const bool access_by_bytes = true;
     const bool access_by_blocks = false;

Modified: trunk/boost/dynamic_bitset/dynamic_bitset.hpp
==============================================================================
--- trunk/boost/dynamic_bitset/dynamic_bitset.hpp (original)
+++ trunk/boost/dynamic_bitset/dynamic_bitset.hpp 2008-08-31 07:53:45 EDT (Sun, 31 Aug 2008)
@@ -1003,7 +1003,12 @@
 {
     using namespace detail::dynamic_bitset_impl;
 
- const bool no_padding = bits_per_block == CHAR_BIT * sizeof(Block);
+ // NOTE: I'm explicitly qualifying "bits_per_block" to workaround
+ // regressions of gcc 3.4.x
+ const bool no_padding =
+ dynamic_bitset<Block, Allocator>::bits_per_block
+ == CHAR_BIT * sizeof(Block);
+
     const bool enough_table_width = table_width >= CHAR_BIT;
 
     const bool mode = (no_padding && enough_table_width)
@@ -1145,7 +1150,8 @@
     // his own allocator.
     //
 
- const size_type m = detail::vector_max_size_workaround(m_bits);
+ const size_type m = detail::dynamic_bitset_impl::
+ vector_max_size_workaround(m_bits);
 
     return m <= (size_type(-1)/bits_per_block) ?
         m * bits_per_block :


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk