Compare commits

...

3 Commits

Author SHA1 Message Date
Marshall Clow
c0e47bb5b7 Release 1.51.0
[SVN r80098]
2012-08-20 22:07:05 +00:00
Marshall Clow
f44fbae9ba Merge fixes to release; Fixes #5439
[SVN r72331]
2011-06-01 15:59:04 +00:00
Steven Watanabe
e6fc8e8ec9 Merge dynamic_bitset from the trunk
[SVN r67617]
2011-01-03 16:38:46 +00:00
3 changed files with 20 additions and 6 deletions

View File

@@ -71,8 +71,8 @@ void run_numeric_ctor_tests( BOOST_EXPLICIT_TEMPLATE_TYPE(Tests)
};
const T numbers[] = {
T(-1), T(-3), T(-8), T(-15), mi/2, mi,
0, 1, 3, 8, 15, ma/2, ma
T(-1), T(-3), T(-8), T(-15), T(mi/2), T(mi),
T(0), T(1), T(3), T(8), T(15), T(ma/2), T(ma)
};
for (std::size_t s = 0; s < BOOST_BITSET_TEST_COUNT(sizes); ++s) {

View File

@@ -212,6 +212,7 @@ public:
bool <a href="#is_subset_of">is_subset_of</a>(const dynamic_bitset&amp; a) const;
bool <a href="#is_proper_subset_of">is_proper_subset_of</a>(const dynamic_bitset&amp; a) const;
bool <a href="#intersects">intersects</a>(const dynamic_bitset&amp; a) const;
size_type <a href="#find_first">find_first</a>() const;
size_type <a href="#find_next">find_next</a>(size_type pos) const;
@@ -1174,6 +1175,19 @@ also set and if <tt>this-&gt;count() &lt; a.count()</tt>.
Otherwise this function returns false.<br />
<b>Throws:</b> nothing.
<hr />
<pre>
bool <a id=
"intersects">intersects</a>(const dynamic_bitset&amp; a) const
</pre>
<b>Requires:</b> <tt>this-&gt;size() == a.size()</tt><br />
<b>Returns:</b> true if this bitset and <tt>a</tt> intersect.
That is, it returns true if, there is a bit which is set in this
bitset, such that the corresponding bit in bitset <tt>a</tt> is
also set. Otherwise this function returns false.<br />
<b>Throws:</b> nothing.
<hr />
<pre>
size_type <a id = "find_first">find_first</a>() const;

View File

@@ -54,7 +54,7 @@ class dynamic_bitset
// of VC++ are likely able to digest a more drinking form of the
// code; but changing it now is probably not worth the risks...]
BOOST_STATIC_ASSERT(detail::dynamic_bitset_impl::allowed_block_type<Block>::value);
BOOST_STATIC_ASSERT((bool)detail::dynamic_bitset_impl::allowed_block_type<Block>::value);
public:
typedef Block block_type;
@@ -670,7 +670,7 @@ resize(size_type num_bits, bool value) // strong guarantee
if (value && (num_bits > m_num_bits)) {
const size_type extra_bits = count_extra_bits();
const block_width_type extra_bits = count_extra_bits();
if (extra_bits) {
assert(old_num_blocks >= 1 && old_num_blocks <= m_bits.size());
@@ -1108,10 +1108,10 @@ to_ulong() const
// beyond the "allowed" positions
typedef unsigned long result_type;
const size_type max_size =
const size_type maximum_size =
(std::min)(m_num_bits, static_cast<size_type>(ulong_width));
const size_type last_block = block_index( max_size - 1 );
const size_type last_block = block_index( maximum_size - 1 );
assert((last_block * bits_per_block) < static_cast<size_type>(ulong_width));