Boost logo

Boost-Commit :

From: gennaro.prota_at_[hidden]
Date: 2008-08-21 07:49:12


Author: gennaro_prota
Date: 2008-08-21 07:49:12 EDT (Thu, 21 Aug 2008)
New Revision: 48280
URL: http://svn.boost.org/trac/boost/changeset/48280

Log:
dynamic_bitset: tentative code reworking in count() member function, to help gcc 3.4.6 on Sandia-sun, which seems to have troubles with a simple constant expression of enumeration type (see <http://www.boost.org/development/tests/trunk/developer/dynamic_bitset_.html>)
Text files modified:
   trunk/boost/dynamic_bitset/dynamic_bitset.hpp | 11 ++++++-----
   1 files changed, 6 insertions(+), 5 deletions(-)

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-21 07:49:12 EDT (Thu, 21 Aug 2008)
@@ -953,7 +953,6 @@
     return b;
 }
 
-
 template <typename Block, typename Allocator>
 typename dynamic_bitset<Block, Allocator>::size_type
 dynamic_bitset<Block, Allocator>::count() const
@@ -962,12 +961,14 @@
 
     const bool no_padding = bits_per_block == CHAR_BIT * sizeof(Block);
     const bool enough_table_width = table_width >= CHAR_BIT;
+ const mode m = (no_padding && enough_table_width)
+ ? access_by_bytes
+ : access_by_blocks;
 
- typedef mode_to_type< (no_padding && enough_table_width ?
- access_by_bytes : access_by_blocks) > m;
-
- return do_count(m_bits.begin(), num_blocks(), Block(0), static_cast<m*>(0));
+ typedef mode_to_type<m> m_type;
 
+ return do_count(m_bits.begin(), num_blocks(), Block(0),
+ static_cast<m_type *>(0));
 }
 
 


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