mirror of
https://github.com/boostorg/dynamic_bitset.git
synced 2026-01-23 05:32:09 +00:00
Compare commits
7 Commits
boost-1.37
...
boost-1.45
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
85fbac8591 | ||
|
|
d77a2c4afa | ||
|
|
e3a2ca7276 | ||
|
|
38819630fd | ||
|
|
6d0f9801f5 | ||
|
|
b7eedd0f46 | ||
|
|
16ca9cbb3c |
@@ -20,19 +20,13 @@
|
||||
# define BOOST_OLD_IOSTREAMS
|
||||
#endif
|
||||
|
||||
// this should be in the config system some day
|
||||
// see http://lists.boost.org/MailArchives/boost/msg62291.php
|
||||
#define BOOST_DYNAMIC_BITSET_GNUC_VERSION ( (__GNUC__) * 100 * 100 \
|
||||
+ (__GNUC_MINOR__) * 100)
|
||||
|
||||
// no-op function to workaround gcc bug c++/8419
|
||||
//
|
||||
namespace boost { namespace detail {
|
||||
template <typename T> T make_non_const(T t) { return t; }
|
||||
}}
|
||||
|
||||
#if defined(__GNUC__) && BOOST_WORKAROUND(BOOST_DYNAMIC_BITSET_GNUC_VERSION, \
|
||||
BOOST_TESTED_AT(30300))
|
||||
#if defined(__GNUC__)
|
||||
# define BOOST_DYNAMIC_BITSET_WRAP_CONSTANT(expr) \
|
||||
(boost::detail::make_non_const(expr))
|
||||
#else
|
||||
|
||||
@@ -476,24 +476,18 @@ BOOST_DYNAMIC_BITSET_PRIVATE:
|
||||
|
||||
};
|
||||
|
||||
#if defined(__IBMCPP__) && BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
|
||||
#if !defined BOOST_NO_INCLASS_MEMBER_INITIALIZATION
|
||||
|
||||
// Workaround for IBM's AIX platform.
|
||||
// See http://comments.gmane.org/gmane.comp.lib.boost.user/15331
|
||||
//
|
||||
// NOTE:
|
||||
// The compiler is actually right, until core issue 454 will be settled:
|
||||
// <http://www.open-std.org/JTC1/SC22/WG21/docs/cwg_active.html#454>
|
||||
//
|
||||
// It's arguable whether we want to mark this with BOOST_WORKAROUND or not.
|
||||
|
||||
|
||||
template<typename Block, typename Allocator>
|
||||
dynamic_bitset<Block, Allocator>::block_width_type const
|
||||
template <typename Block, typename Allocator>
|
||||
const typename dynamic_bitset<Block, Allocator>::block_width_type
|
||||
dynamic_bitset<Block, Allocator>::bits_per_block;
|
||||
|
||||
template<typename Block, typename Allocator>
|
||||
dynamic_bitset<Block, Allocator>::block_width_type const
|
||||
template <typename Block, typename Allocator>
|
||||
const typename dynamic_bitset<Block, Allocator>::size_type
|
||||
dynamic_bitset<Block, Allocator>::npos;
|
||||
|
||||
template <typename Block, typename Allocator>
|
||||
const typename dynamic_bitset<Block, Allocator>::block_width_type
|
||||
dynamic_bitset<Block, Allocator>::ulong_width;
|
||||
|
||||
#endif
|
||||
@@ -1005,20 +999,26 @@ dynamic_bitset<Block, Allocator>::count() const
|
||||
using detail::dynamic_bitset_impl::access_by_blocks;
|
||||
using detail::dynamic_bitset_impl::value_to_type;
|
||||
|
||||
#if BOOST_WORKAROUND(__GNUC__, == 4) && (__GNUC_MINOR__ == 3) && (__GNUC_PATCHLEVEL__ == 3)
|
||||
// NOTE: Explicit qualification of "bits_per_block"
|
||||
// breaks compilation on gcc 4.3.3
|
||||
enum { no_padding = bits_per_block == CHAR_BIT * sizeof(Block) };
|
||||
#else
|
||||
// NOTE: Explicitly qualifying "bits_per_block" to workaround
|
||||
// regressions of gcc 3.4.x
|
||||
const bool no_padding =
|
||||
enum { no_padding =
|
||||
dynamic_bitset<Block, Allocator>::bits_per_block
|
||||
== CHAR_BIT * sizeof(Block);
|
||||
== CHAR_BIT * sizeof(Block) };
|
||||
#endif
|
||||
|
||||
const bool enough_table_width = table_width >= CHAR_BIT;
|
||||
enum { enough_table_width = table_width >= CHAR_BIT };
|
||||
|
||||
const bool mode = (no_padding && enough_table_width)
|
||||
enum { mode = (no_padding && enough_table_width)
|
||||
? access_by_bytes
|
||||
: access_by_blocks;
|
||||
: access_by_blocks };
|
||||
|
||||
return do_count(m_bits.begin(), num_blocks(), Block(0),
|
||||
static_cast<value_to_type<mode> *>(0));
|
||||
static_cast<value_to_type<(bool)mode> *>(0));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user