Compare commits

..

2 Commits

Author SHA1 Message Date
nobody
6d0e238609 This commit was manufactured by cvs2svn to create tag
'Version_1_33_1'.

[SVN r31916]
2005-12-05 14:04:06 +00:00
nobody
f4254a239e This commit was manufactured by cvs2svn to create branch 'RC_1_33_0'.
[SVN r30300]
2005-07-28 18:22:24 +00:00
17 changed files with 475 additions and 437 deletions

21
Jamfile Normal file
View File

@@ -0,0 +1,21 @@
subproject libs/dynamic_bitset ;
unit-test dyn_bitset_unit_tests1
: dyn_bitset_unit_tests1.cpp
: <include>$(BOOST_ROOT)
;
unit-test dyn_bitset_unit_tests2
: dyn_bitset_unit_tests2.cpp
: <include>$(BOOST_ROOT)
;
unit-test dyn_bitset_unit_tests3
: dyn_bitset_unit_tests3.cpp
: <include>$(BOOST_ROOT)
;
unit-test dyn_bitset_unit_tests4
: dyn_bitset_unit_tests4.cpp
: <include>$(BOOST_ROOT)
;

View File

@@ -1,9 +1,3 @@
#
# Copyright Vladimir Prus 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)
test-suite dynamic_bitset :

View File

@@ -1,14 +1,13 @@
// --------------------------------------------------
// (C) Copyright Jeremy Siek 2001.
// (C) Copyright Gennaro Prota 2003 - 2006.
// (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)
//
// -----------------------------------------------------------
//
// $Id$
#ifndef BOOST_BITSET_TEST_HPP_GP_20040319
#define BOOST_BITSET_TEST_HPP_GP_20040319
@@ -19,13 +18,13 @@
#endif
#include <vector>
#include <fstream> // used for operator<<
#include <fstream> // used for operator<< :( - gps
#include <string> // for (basic_string and) getline()
#include <algorithm> // for std::min
#include <assert.h> // <cassert> is sometimes macro-guarded :-(
#include <cassert>
#include "boost/limits.hpp"
#include "boost/dynamic_bitset/dynamic_bitset.hpp"
#include "boost/dynamic_bitset.hpp"
#include "boost/test/minimal.hpp"
@@ -34,9 +33,7 @@ inline bool nth_bit(Block num, std::size_t n)
{
#ifdef __BORLANDC__
// Borland deduces Block as a const qualified type,
// and thus finds numeric_limits<Block> to be zero :(
// (though not directly relevant here, see also
// lib issue 559)
// and finds numeric_limits<Block> to be zero :(
int block_width = sizeof(Block) * CHAR_BIT;
#else
int block_width = std::numeric_limits<Block>::digits;
@@ -80,20 +77,20 @@ bool is_white_space(const Stream & /*s*/, char c)
}
#else
template <typename Stream, typename Ch>
bool is_one_or_zero(const Stream& s, Ch c)
bool is_one_or_zero(const Stream& s, Ch c) // gps
{
typedef typename Stream::traits_type Tr;
const Ch zero = s.widen('0');
const Ch one = s.widen('1');
return Tr::eq(c, one) || Tr::eq(c, zero);
return Tr::eq(c, one) || Tr::eq(c, zero) ;
}
template <typename Stream, typename Ch>
bool is_white_space(const Stream & s, Ch c)
{
// NOTE: the using directive is to satisfy Borland 5.6.4
// with its own library (STLport), which doesn't
// like std::isspace(c, loc)
// with its own library (STLport), which chokes
// on std::isspace(c, loc) - gps
using namespace std;
return isspace(c, s.getloc());
}
@@ -115,29 +112,25 @@ bool has_flags(const Stream& s, std::ios::iostate flags)
template <typename Bitset>
struct bitset_test {
typedef typename Bitset::block_type Block;
BOOST_STATIC_CONSTANT(int, bits_per_block = Bitset::bits_per_block);
static void from_unsigned_long(std::size_t sz, unsigned long num)
static void from_unsigned_long(std::size_t N, unsigned long num)
{
// An object of size N = sz is constructed:
// - the first M bit positions are initialized to the corresponding bit
// values in num (M being the smaller of N and the width of unsigned
// long)
//
// - if M < N remaining bit positions are initialized to zero
// initializes the first M bit position to the cooresponding bit
// values in val. M is the smaller of N and the width of unsigned
// long
Bitset b(sz, num);
BOOST_CHECK(b.size() == sz);
// missing from the std?
// if M < N then the remaining bit positions are initialized to zero
Bitset b(N, num);
BOOST_CHECK(b.size() == N);
const std::size_t ulong_width = std::numeric_limits<unsigned long>::digits;
std::size_t m = (std::min)(sz, ulong_width);
std::size_t i;
for (i = 0; i < m; ++i)
BOOST_CHECK(b.test(i) == nth_bit(num, i));
for ( ; i < sz; ++i)
BOOST_CHECK(b.test(i) == 0);
std::size_t M = (std::min)(N, ulong_width);
std::size_t I;
for (I = 0; I < M; ++I)
BOOST_CHECK(b[I] == nth_bit(num, I));
for (; I < N; ++I)
BOOST_CHECK(b[I] == 0);
}
// from string
@@ -157,7 +150,7 @@ struct bitset_test {
std::size_t num_bits = (std::size_t)(-1))
{
std::size_t rlen = (std::min)(max_char, str.size() - pos);
std::size_t rlen = (std::min)(max_char, str.size() - pos); // [gps]
// The resulting size N of the bitset is num_bits, if
// that is different from the default arg, rlen otherwise.
@@ -176,7 +169,7 @@ struct bitset_test {
std::size_t m = (std::min)(num_bits, rlen);
std::size_t j;
for (j = 0; j < m; ++j)
BOOST_CHECK(b[j] == (str[pos + m - 1 - j] == '1'));
BOOST_CHECK(b[j] == (str[pos + m - 1 - j] == '1')); // [gps]
// If M < N, remaining bit positions are zero
for (; j < actual_size; ++j)
BOOST_CHECK(b[j] == 0);
@@ -184,6 +177,9 @@ struct bitset_test {
}
typedef typename Bitset::block_type Block;
BOOST_STATIC_CONSTANT(int, bits_per_block = Bitset::bits_per_block);
static void to_block_range(const Bitset & b /*, BlockOutputIterator result*/)
{
typedef typename Bitset::size_type size_type;
@@ -212,7 +208,7 @@ struct bitset_test {
}
}
// TODO from_block_range (below) should be splitted
// gps - TODO from_block_range (below) should be splitted
// PRE: std::equal(first1, last1, first2) == true
static void from_block_range(const std::vector<Block>& blocks)
@@ -240,7 +236,7 @@ struct bitset_test {
BOOST_CHECK(bset[bit] == nth_bit(blocks[b], i));
}
}
BOOST_CHECK(n <= bset.num_blocks());
BOOST_CHECK(n <= bset.num_blocks()); // gps - ok? ask on the list
}
}
@@ -276,17 +272,15 @@ struct bitset_test {
static void swap(const Bitset& lhs, const Bitset& rhs)
{
// bitsets must be swapped
Bitset copy1(lhs);
Bitset copy2(rhs);
copy1.swap(copy2);
Bitset b1(lhs);
Bitset b2(rhs);
b1.swap(b2);
BOOST_CHECK(copy1 == rhs);
BOOST_CHECK(copy2 == lhs);
BOOST_CHECK(b1 == rhs);
BOOST_CHECK(b2 == lhs);
// references must be stable under a swap
for(typename Bitset::size_type i = 0; i < lhs.size(); ++i) {
Bitset b1(lhs);
Bitset b2(rhs);
for(typename Bitset::size_type i = 0; i < b1.size(); ++i) {
typename Bitset::reference ref = b1[i];
bool x = ref;
if (i < b2.size())
@@ -294,8 +288,7 @@ struct bitset_test {
b1.swap(b2);
BOOST_CHECK(b2[i] == x); // now it must be equal..
b2.flip(i);
BOOST_CHECK(ref == b2[i]); // .. and ref must be into b2
BOOST_CHECK(ref == !x);
BOOST_CHECK(ref == !x); // .. and ref must be into b2
}
}
@@ -350,7 +343,7 @@ struct bitset_test {
static void append_block(const Bitset& lhs)
{
Bitset b(lhs);
Block value(128);
Block value(128); // gps
b.append(value);
BOOST_CHECK(b.size() == lhs.size() + bits_per_block);
for (typename Bitset::block_width_type i = 0; i < bits_per_block; ++i)
@@ -622,35 +615,29 @@ struct bitset_test {
// to_ulong()
static void to_ulong(const Bitset& lhs)
{
typedef unsigned long result_type;
std::size_t n = std::numeric_limits<result_type>::digits;
std::size_t sz = lhs.size();
std::size_t N = lhs.size();
std::size_t n = std::numeric_limits<unsigned long>::digits;
bool will_overflow = false;
for (std::size_t i = n; i < sz; ++i) {
if (lhs.test(i) != 0) {
for (std::size_t I = n; I < N; ++I)
if (lhs[I] != 0)
will_overflow = true;
break;
}
}
if (will_overflow) {
try {
(void)lhs.to_ulong();
BOOST_CHECK(false); // It should have thrown an exception
} catch (std::overflow_error & ex) {
} catch (std::overflow_error) {
// Good!
BOOST_CHECK(!!ex.what());
} catch (...) {
BOOST_CHECK(false); // threw the wrong exception
}
} else {
result_type num = lhs.to_ulong();
// Be sure the number is right
if (sz == 0)
unsigned long num = lhs.to_ulong();
// Make sure the number is right
if (N == 0)
BOOST_CHECK(num == 0);
else {
for (std::size_t i = 0; i < sz; ++i)
BOOST_CHECK(lhs[i] == (i < n ? nth_bit(num, i) : 0));
for (std::size_t I = 0; I < N; ++I)
BOOST_CHECK(lhs[I] == (I < n ? nth_bit(num, I) : 0)); //G.P.S. bugfix
}
}
}
@@ -658,21 +645,29 @@ struct bitset_test {
// to_string()
static void to_string(const Bitset& b)
{
// Construct a string object of the appropriate type and initializes
// it to a string of length N characters. Each character is determined
// by the value of its corresponding bit position in b. Character
// position N - 1 corresponds to bit position zero. Sebsequent
// decreasing character positions correspond to increasing bit
// positions. Bit value zero becomes the charactet 0, bit value one
// becomes the character 1.
std::string str;
boost::to_string(b, str);
std::size_t N = b.size();
BOOST_CHECK(str.size() == b.size());
for (std::size_t i = 0; i < b.size(); ++i)
BOOST_CHECK(str[b.size() - 1 - i] ==(b.test(i)? '1':'0'));
for (std::size_t I = 0; I < b.size(); ++I)
BOOST_CHECK(b[I] == 0 ? (str[N - 1 - I] == '0') : (str[N - 1 - I] == '1'));
}
static void count(const Bitset& b)
{
std::size_t c = b.count();
std::size_t actual = 0;
for (std::size_t i = 0; i < b.size(); ++i)
if (b[i])
++actual;
BOOST_CHECK(c == actual);
std::size_t c_real = 0;
for (std::size_t I = 0; I < b.size(); ++I)
if (b[I])
++c_real;
BOOST_CHECK(c == c_real);
}
static void size(const Bitset& b)
@@ -682,82 +677,47 @@ struct bitset_test {
static void any(const Bitset& b)
{
//BOOST_CHECK(b.any() == (b.count() > 0));
bool result = false;
for(std::size_t i = 0; i < b.size(); ++i)
if(b[i]) {
result = true;
break;
}
BOOST_CHECK(b.any() == result);
BOOST_CHECK(b.any() == (b.count() > 0));
}
static void none(const Bitset& b)
{
bool result = true;
for(std::size_t i = 0; i < b.size(); ++i) {
if(b[i]) {
result = false;
break;
}
}
BOOST_CHECK(b.none() == result);
// sanity
BOOST_CHECK(b.none() == !b.any());
BOOST_CHECK(b.none() == (b.count() == 0));
}
static void subset(const Bitset& a, const Bitset& b)
{
BOOST_CHECK(a.size() == b.size()); // PRE
bool is_subset = true;
if (b.size()) { // could use b.any() but let's be safe
for(std::size_t i = 0; i < a.size(); ++i) {
if(a.test(i) && !b.test(i)) {
if (a.is_subset_of(b)) {
for (std::size_t I = 0; I < a.size(); ++I)
if (a[I])
BOOST_CHECK(b[I]);
} else {
bool is_subset = true;
for (std::size_t I = 0; I < a.size(); ++I)
if (a[I] && !b[I]) {
is_subset = false;
break;
}
}
BOOST_CHECK(is_subset == false);
}
else {
// sanity
BOOST_CHECK(a.count() == 0);
BOOST_CHECK(a.any() == false);
//is_subset = (a.any() == false);
}
BOOST_CHECK(a.is_subset_of(b) == is_subset);
}
static void proper_subset(const Bitset& a, const Bitset& b)
{
// PRE: a.size() == b.size()
BOOST_CHECK(a.size() == b.size());
bool is_proper = false;
if (b.size() != 0) {
// check it's a subset
subset(a, b);
// is it proper?
for (std::size_t i = 0; i < a.size(); ++i) {
if (!a.test(i) && b.test(i)) {
is_proper = true;
// sanity
BOOST_CHECK(a.count() < b.count());
BOOST_CHECK(b.any());
if (a.is_proper_subset_of(b)) {
for (std::size_t I = 0; I < a.size(); ++I)
if (a[I])
BOOST_CHECK(b[I]);
BOOST_CHECK(a.count() < b.count());
} else {
bool is_subset = true;
for (std::size_t I = 0; I < a.size(); ++I)
if (a[I] && !b[I]) {
is_subset = false;
break;
}
}
BOOST_CHECK(is_subset == false || a.count() >= b.count());
}
BOOST_CHECK(a.is_proper_subset_of(b) == is_proper);
if (is_proper)
BOOST_CHECK(b.is_proper_subset_of(a) != is_proper);// antisymmetry
}
static void intersects(const Bitset& a, const Bitset& b)
@@ -770,7 +730,7 @@ struct bitset_test {
have_intersection = true;
BOOST_CHECK(a.intersects(b) == have_intersection);
// also check commutativity
// also check it is commutative
BOOST_CHECK(b.intersects(a) == have_intersection);
}
@@ -1021,14 +981,14 @@ struct bitset_test {
}
#endif
BOOST_CHECK(did_throw || !stream_was_good || (s.width() == 0));
BOOST_CHECK(did_throw || !stream_was_good || (s.width() == 0)); // gps
if (!stream_was_good) {
if (!stream_was_good) { // gps
BOOST_CHECK(s.good() == false);
// this should actually be oldstate == s.rdstate()
// but some implementations add badbit in the
// sentry constructor
// sentry constructor - gps
//
BOOST_CHECK((oldstate & s.rdstate()) == oldstate);
BOOST_CHECK(s.width() == w);
@@ -1040,7 +1000,7 @@ struct bitset_test {
// Of course dynamic_bitset's operator << doesn't require that.
size_type total_len = w <= 0 || (size_type)(w) < b.size()? b.size() : w;
const string_type padding (total_len - b.size(), fill_char);
const string_type padding (total_len - b.size(), fill_char); // gps
string_type expected;
boost::to_string(b, expected);
if ((s.flags() & std::ios::adjustfield) != std::ios::left)
@@ -1054,7 +1014,7 @@ struct bitset_test {
s.close();
corresponding_input_stream_type is(file_name);
string_type contents;
std::getline(is, contents, char_type());
std::getline(is, contents, char_type()); // gps
BOOST_CHECK(contents == expected);
}
}
@@ -1085,7 +1045,7 @@ struct bitset_test {
}
catch(const std::ios::failure &) {
did_throw = true;
}
}// catch bad alloc?? - gps
// postconditions
BOOST_CHECK(except == is.exceptions()); // paranoid
@@ -1141,7 +1101,7 @@ struct bitset_test {
// eofbit
if((after_digits == len && max_digits > num_digits ))
BOOST_CHECK(has_flags(is, std::ios::eofbit));
BOOST_CHECK(has_flags(is, std::ios::eofbit)); // gps
else
BOOST_CHECK(!has_flags(is, std::ios::eofbit));
@@ -1184,16 +1144,16 @@ struct bitset_test {
// bitset though there's nothing in the file to be extracted.
// Note that the dynamic_bitset docs say a sentry object is
// constructed and then converted to bool, thus we rely on
// what the underlying library does.
// what the underlying library does. - gps
//
#if !defined(BOOST_DINKUMWARE_STDLIB) || (BOOST_DINKUMWARE_STDLIB >= 306)
#if !defined(BOOST_DINKUMWARE_STDLIB) || (BOOST_DINKUMWARE_STDLIB >= 306) // what about STLPORT? - gps
BOOST_CHECK(b == a_copy);
#else
BOOST_CHECK(b.empty() == true);
#endif
}
else {
String sub = str.substr(after_spaces, num_digits);
String sub = str.substr(after_spaces, num_digits); // gps
BOOST_CHECK(b == Bitset(sub));
}
@@ -1206,7 +1166,7 @@ struct bitset_test {
// clear the stream to allow further reading then
// retrieve any remaining chars with a single getline()
is.exceptions(std::ios::goodbit);
is.clear();
is.clear(); // gps
String remainder;
std::getline(is, remainder, Ch());
if(stream_was_good)

View File

@@ -1,29 +1,24 @@
// --------------------------------------------------------
// (C) Copyright Jeremy Siek 2001.
// (C) Copyright Gennaro Prota 2003 - 2006.
// (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)
//
// -----------------------------------------------------------
//
// $Id$
#include "bitset_test.hpp"
#include "boost/dynamic_bitset/dynamic_bitset.hpp"
#include "boost/dynamic_bitset.hpp"
#include "boost/limits.hpp"
#include "boost/config.hpp"
#include "boost/detail/workaround.hpp"
#define BOOST_BITSET_TEST_COUNT_OF(x) (sizeof(x)/sizeof(x[0]))
// Codewarrior 8.3 for Win fails without this.
// Thanks Howard Hinnant ;)
#if defined __MWERKS__ && BOOST_WORKAROUND(__MWERKS__, <= 0x3003) // 8.x
# pragma parse_func_templ off
#if BOOST_WORKAROUND(__MWERKS__, <= 0x3003) // 8.x
#pragma parse_func_templ off
#endif
@@ -60,32 +55,45 @@ template <typename Block>
void run_test_cases( BOOST_EXPLICIT_TEMPLATE_TYPE(Block) )
{
typedef boost::dynamic_bitset<Block> bitset_type;
typedef bitset_test<bitset_type> Tests;
typedef bitset_test< bitset_type > Tests;
const int bits_per_block = bitset_type::bits_per_block;
const std::string long_string = get_long_string();
const Block all_1s = static_cast<Block>(-1);
//=====================================================================
// Test construction from unsigned long
{
typedef unsigned long source_type;
const std::size_t source_width = std::numeric_limits<source_type>::digits;
const source_type source_max =(std::numeric_limits<source_type>::max)();
const std::size_t ulong_width = std::numeric_limits<unsigned long>::digits;
const unsigned long ulong_max =(std::numeric_limits<unsigned long>::max)();
source_type numbers[] = { 0, 1, 40247, source_max >> 1, source_max };
std::size_t sizes[] =
{ 0, 7 * source_width / 10, source_width, 13 * source_width / 10,
7 * bits_per_block / 10, bits_per_block, 13 * bits_per_block / 10,
3 * bits_per_block };
unsigned long numbers[] = { 0, 1, 40247, ulong_max >> 1, ulong_max };
const std::size_t array_count = sizeof(numbers) / sizeof(numbers[0]);
const std::size_t value_count = BOOST_BITSET_TEST_COUNT_OF(numbers);
const std::size_t size_count = BOOST_BITSET_TEST_COUNT_OF(sizes);
for (std::size_t i = 0; i < array_count; ++i) {
unsigned long number = numbers[i];
std::size_t n = 0;
Tests::from_unsigned_long(n, number);
for (std::size_t v = 0; v < value_count; ++v) {
for (std::size_t s = 0; s < size_count; ++s) {
Tests::from_unsigned_long(sizes[s], numbers[v]);
}
n = std::size_t(0.7 * double(ulong_width));
Tests::from_unsigned_long(n, number);
n = 1 * ulong_width;
Tests::from_unsigned_long(n, number);
n = std::size_t(1.3 * double(ulong_width));
Tests::from_unsigned_long(n, number);
n = std::size_t(0.7 * double(bits_per_block));
Tests::from_unsigned_long(n, number);
n = 1 * bits_per_block;
Tests::from_unsigned_long(n, number);
n = std::size_t(1.3 * double(bits_per_block));
Tests::from_unsigned_long(n, number);
n = 3 * bits_per_block;
Tests::from_unsigned_long(n, number);
}
}
//=====================================================================
@@ -102,7 +110,7 @@ void run_test_cases( BOOST_EXPLICIT_TEMPLATE_TYPE(Block) )
// one hand I should have better tests. On the other one
// I don't want tests for dynamic_bitset to cope with locales,
// ctype::widen, etc. (but that's what you deserve when you
// don't separate concerns at the library level)
// don't separate concerns at the library level) - gps
//
run_string_tests<Tests>(
std::wstring(L"11111000000111111111010101010101010101010111111"));
@@ -115,7 +123,8 @@ void run_test_cases( BOOST_EXPLICIT_TEMPLATE_TYPE(Block) )
}
//=====================================================================
// test from_block_range
// Test construction from a block range
// [gps - this comment is erroneous]
{
std::vector<Block> blocks;
Tests::from_block_range(blocks);
@@ -124,7 +133,7 @@ void run_test_cases( BOOST_EXPLICIT_TEMPLATE_TYPE(Block) )
std::vector<Block> blocks(3);
blocks[0] = static_cast<Block>(0);
blocks[1] = static_cast<Block>(1);
blocks[2] = all_1s;
blocks[2] = ~Block(0);
Tests::from_block_range(blocks);
}
{
@@ -296,7 +305,7 @@ void run_test_cases( BOOST_EXPLICIT_TEMPLATE_TYPE(Block) )
std::vector<Block> blocks(3);
blocks[0] = static_cast<Block>(0);
blocks[1] = static_cast<Block>(1);
blocks[2] = all_1s;
blocks[2] = ~Block(0);
Tests::append_block_range(a, blocks);
}
{
@@ -321,7 +330,7 @@ void run_test_cases( BOOST_EXPLICIT_TEMPLATE_TYPE(Block) )
std::vector<Block> blocks(3);
blocks[0] = static_cast<Block>(0);
blocks[1] = static_cast<Block>(1);
blocks[2] = all_1s;
blocks[2] = ~Block(0);
Tests::append_block_range(a, blocks);
}
//=====================================================================

View File

@@ -1,17 +1,16 @@
// --------------------------------------------------------
// (C) Copyright Jeremy Siek 2001.
// (C) Copyright Gennaro Prota 2003 - 2006.
// (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)
//
// -----------------------------------------------------------
//
// $Id$
#include "bitset_test.hpp"
#include "boost/dynamic_bitset/dynamic_bitset.hpp"
#include "boost/dynamic_bitset.hpp"
#include "boost/config.hpp"

View File

@@ -1,18 +1,16 @@
// --------------------------------------------------------
// (C) Copyright Jeremy Siek 2001.
// (C) Copyright Gennaro Prota 2003 - 2006.
// (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)
//
// -----------------------------------------------------------
//
// $Id$
#include <assert.h>
#include "bitset_test.hpp"
#include "boost/dynamic_bitset/dynamic_bitset.hpp"
#include "boost/dynamic_bitset.hpp"
#include "boost/limits.hpp"
#include "boost/config.hpp"
@@ -20,7 +18,7 @@
template <typename Block>
void run_test_cases( BOOST_EXPLICIT_TEMPLATE_TYPE(Block) )
{
// a bunch of typedefs which will be handy later on
// a bunch of typedefs to have handy later on
typedef boost::dynamic_bitset<Block> bitset_type;
typedef bitset_test<bitset_type> Tests;
// typedef typename bitset_type::size_type size_type; // unusable with Borland 5.5.1
@@ -32,7 +30,7 @@ void run_test_cases( BOOST_EXPLICIT_TEMPLATE_TYPE(Block) )
// Test b.empty()
{
bitset_type b;
Tests::empty(b);
Tests::empty(b); // gps
}
{
bitset_type b(1, 1ul);
@@ -54,13 +52,9 @@ void run_test_cases( BOOST_EXPLICIT_TEMPLATE_TYPE(Block) )
Tests::to_ulong(b);
}
{
Block all_ones = ~Block(0);
boost::dynamic_bitset<Block> b(bitset_type::bits_per_block,
static_cast<unsigned long>(-1));
Tests::to_ulong(b);
}
{
std::string str(ul_width - 1, '1');
boost::dynamic_bitset<Block> b(str);
static_cast<unsigned long>(all_ones));
Tests::to_ulong(b);
}
{
@@ -96,14 +90,6 @@ void run_test_cases( BOOST_EXPLICIT_TEMPLATE_TYPE(Block) )
boost::dynamic_bitset<Block> b(std::string("0"));
Tests::count(b);
}
{
boost::dynamic_bitset<Block> b(std::string("1"));
Tests::count(b);
}
{
boost::dynamic_bitset<Block> b(8, 255ul);
Tests::count(b);
}
{
boost::dynamic_bitset<Block> b(long_string);
Tests::count(b);
@@ -402,10 +388,6 @@ void run_test_cases( BOOST_EXPLICIT_TEMPLATE_TYPE(Block) )
boost::dynamic_bitset<Block> a(std::string("1")), b(std::string("1"));
Tests::operator_less_than(a, b);
}
{
boost::dynamic_bitset<Block> a(std::string("10")), b(std::string("11"));
Tests::operator_less_than(a, b);
}
{
boost::dynamic_bitset<Block> a(long_string), b(long_string);
Tests::operator_less_than(a, b);

View File

@@ -1,20 +1,18 @@
// --------------------------------------------------------
// (C) Copyright Jeremy Siek 2001.
// (C) Copyright Gennaro Prota 2003 - 2006.
// (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)
//
// -----------------------------------------------------------
//
// $Id$
#include <fstream>
#include <string>
#include <cstddef> // for std::size_t
#include <cstddef> // for std::size_t
#include <stdexcept> // for std::logic_error
#include <assert.h>
#include <cassert>
#include "boost/config.hpp"
#if !defined (BOOST_NO_STRINGSTREAM)
@@ -22,14 +20,14 @@
#endif
#include "bitset_test.hpp"
#include "boost/dynamic_bitset/dynamic_bitset.hpp"
#include "boost/dynamic_bitset.hpp"
#include "boost/detail/workaround.hpp"
// Codewarrior 8.3 for Win fails without this.
// Thanks Howard Hinnant ;)
#if defined __MWERKS__ && BOOST_WORKAROUND(__MWERKS__, <= 0x3003) // 8.x
# pragma parse_func_templ off
#if BOOST_WORKAROUND(__MWERKS__, <= 0x3003) // 8.x
#pragma parse_func_templ off
#endif
@@ -44,15 +42,9 @@ std::wstring widen_string( const std::string & str,
std::wstring result;
const std::string::size_type len = str.length();
if(len != 0) {
typedef std::ctype<wchar_t> ct_type;
typedef std::wstring::traits_type tr_type;
const ct_type & ct = BOOST_USE_FACET(ct_type, loc);
result.resize(len);
for (std::size_t i = 0; i < len; ++i)
tr_type::assign(result[i], ct.widen(str[i]));
BOOST_USE_FACET(std::ctype<wchar_t>, loc)
.widen(&str[0], 1 + &str[len-1], &result[0]);
}
return result;
}
@@ -136,7 +128,7 @@ void run_test_cases( BOOST_EXPLICIT_TEMPLATE_TYPE(Block) )
}
{
//NOTE: there are NO string stream tests
//NOTE: there are NO string stream tests - gps
}
#if !defined (BOOST_DYNAMIC_BITSET_NO_WCHAR_T_TESTS)
{
@@ -171,7 +163,7 @@ void run_test_cases( BOOST_EXPLICIT_TEMPLATE_TYPE(Block) )
// a good "real life" test. Some characters, such as '\v' and '\f', are not
// used exactly because they are the ones which will most likely give problems
// on some systems (for instance '\f' could actually be written as a sequence
// of new-lines, and we could never be able to read it back)
// of new-lines, and we could never be able to read it back) [gps]
//
// Note how the bitset object is not initially empty. That helps checking
// that it isn't erroneously clear()ed by operator>>.

View File

@@ -46,6 +46,20 @@ align="middle" width="277" height="86">
<br>
</p>
<!-- BEGIN TODO
TODO:
<ul>
<li> ask to Jeremy about reference::operator&amp; and about
making reference itself private</li>
<li>check the whole synopsis against code changes </li>
<li>document intersects() after we reach consensus</li>
</ul>
<br>
Note:
Other things to do are marked by "[gps]"
END TODO -->
<h1>dynamic_bitset&lt;Block, Allocator&gt;</h1>
<h2>Contents</h2>
@@ -131,7 +145,7 @@ public:
typedef Block <a href="#block_type">block_type</a>;
typedef Allocator <a href="#allocator_type">allocator_type</a>;
typedef <i>implementation-defined</i> <a href="#size_type">size_type</a>;
static const int <a href=
"#bits_per_block">bits_per_block</a> = <i>implementation-defined</i>;
static const size_type <a href=
@@ -489,7 +503,7 @@ were chosen for this reason.</p>
<p><tt>dynamic_bitset</tt> does not throw exceptions when a
precondition is violated (as is done in <tt>std::bitset</tt>).
Instead <tt>assert</tt> is used. See the guidelines for <a href=
"http://www.boost.org/more/error_handling.html">Error and Exception Handling</a>
"../../more/error_handling.html">Error and Exception Handling</a>
for the explanation.</p>
<h3><a name="header-files">Header Files</a></h3>
@@ -705,7 +719,7 @@ to <tt>std::numeric_limits&lt;Block&gt;::digits</tt>.
<a name="npos">dynamic_bitset::npos</a>
</pre>
The maximum value of <tt>size_type</tt>.
The maximum value of <tt>size_type</tt>. [gps]
<hr>
<h3><a name="constructors">Constructors</a></h3>
@@ -940,7 +954,7 @@ void <a name=
</pre>
<b>Effects:</b> This function provides the same end result as the
following code, but is typically more efficient.
following code, but is typically more efficient. [gps]
<pre>
for (; first != last; ++first)
@@ -1064,7 +1078,10 @@ dynamic_bitset <a name=
<b>Returns:</b> a copy of <tt>*this</tt> shifted to the left by
<tt>n</tt> bits. For each bit in the returned bitset, the bit at
position pos takes on the value of the bit at position <tt>pos -
n</tt> of this bitset, or zero if no such bit exists.<br>
n</tt> of this bitset, or zero if no such bit exists. Note that
the expression <tt>b &lt;&lt; n</tt> is equivalent to
constructing a temporary copy of <tt>b</tt> and then using
<tt>operator&lt;&lt;=</tt>.<br>
<b>Throws:</b> An allocation error if memory is exhausted
(<tt>std::bad_alloc</tt> if <tt>Allocator=std::allocator</tt>).
@@ -1077,7 +1094,10 @@ dynamic_bitset <a name=
<b>Returns:</b> a copy of <tt>*this</tt> shifted to the right by
<tt>n</tt> bits. For each bit in the returned bitset, the bit at
position pos takes on the value of the bit at position <tt>pos +
n</tt> of this bitset, or zero if no such bit exists.<br>
n</tt> of this bitset, or zero if no such bit exists. Note that
the expression <tt>b &gt;&gt; n</tt> is equivalent to
constructing a temporary copy of <tt>b</tt> and then using
<tt>operator&gt;&gt;=</tt>.<br>
<b>Throws:</b> An allocation error if memory is exhausted
(<tt>std::bad_alloc</tt> if <tt>Allocator=std::allocator</tt>).
@@ -1174,7 +1194,7 @@ object having the same type as <tt>*this</tt>. Note that if
any <tt>dynamic_bitset</tt> operation causes <tt>size()</tt> to
exceed <tt>max_size()</tt> then the <i>behavior is undefined</i>.
<br><br>[The semantics of this function could change slightly
when lib issue 197 will be closed]<br>
when lib issue 197 will be closed - G.P.S.]<br>
<hr>
<pre>
@@ -1185,6 +1205,32 @@ bool <a name="empty">empty</a>() const;
otherwise. <i>Note</i>: not to be confused with <tt>none()</tt>, that has
different semantics.
<hr>
<!-- ***************** To be removed - gps *************************
<pre>
void <a name="reserve">reserve</a>(size_type n);
</pre>
<b>Precondition:</b> <tt>n &lt;= this-&gt;max_size()</tt>.<br>
<b>Effects:</b> informs the <tt>dynamic_bitset</tt> of a planned
change in size(), so that reallocations can be managed accordingly.
If before the call the dynamic_bitset's capacity is >= n then no
reallocation happens and capacity remains unchanged. Otherwise
storage is allocated and capacity becomes greater or equal to n.
In any case, size() does not change.<br>
<b>Throws:</b> An allocation error if <tt>n &gt; capacity()</tt>
and memory is exhausted (<tt>std::bad_alloc</tt> if <tt>
Allocator=std::allocator</tt>).
<hr>
<pre>
size_type <a name="capacity">capacity()</a> const;
</pre>
<b>Returns:</b> the total number of elements that <tt>*this</tt>
can hold without requiring reallocation.<br>
*************************************************************** -->
<hr>
<pre>
size_type <a name="count">count</a>() const
@@ -1390,7 +1436,10 @@ dynamic_bitset <a name=
<b>Requires:</b> <tt>a.size() == b.size()</tt><br>
<b>Returns:</b> A new bitset that is the bitwise-AND of the
bitsets <tt>a</tt> and <tt>b</tt>.<br>
bitsets <tt>a</tt> and <tt>b</tt>. Note that the expression
<tt>b1 &amp; b2</tt> is equivalent to creating a temporary copy
of <tt>b1</tt>, using <tt>operator&amp;=</tt>, and returning the
temporary copy.<br>
<b>Throws:</b> An allocation error if memory is exhausted
(<tt>std::bad_alloc</tt> if <tt>Allocator=std::allocator</tt>).
@@ -1402,7 +1451,10 @@ dynamic_bitset <a name=
<b>Requires:</b> <tt>a.size() == b.size()</tt><br>
<b>Returns:</b> A new bitset that is the bitwise-OR of the
bitsets <tt>a</tt> and <tt>b</tt>.<br>
bitsets <tt>a</tt> and <tt>b</tt>. Note that the expression
<tt>b1 &amp; b2</tt> is equivalent to creating a temporary copy
of <tt>b1</tt>, using <tt>operator&amp;=</tt>, and returning the
temporary copy.<br>
<b>Throws:</b> An allocation error if memory is exhausted
(<tt>std::bad_alloc</tt> if <tt>Allocator=std::allocator</tt>).
@@ -1414,7 +1466,10 @@ dynamic_bitset <a name=
<b>Requires:</b> <tt>a.size() == b.size()</tt><br>
<b>Returns:</b> A new bitset that is the bitwise-XOR of the
bitsets <tt>a</tt> and <tt>b</tt>.<br>
bitsets <tt>a</tt> and <tt>b</tt>. Note that the expression
<tt>b1 &amp; b2</tt> is equivalent to creating a temporary copy
of <tt>b1</tt>, using <tt>operator&amp;=</tt>, and returning the
temporary copy.<br>
<b>Throws:</b> An allocation error if memory is exhausted
(<tt>std::bad_alloc</tt> if <tt>Allocator=std::allocator</tt>).
@@ -1426,7 +1481,10 @@ dynamic_bitset <a name=
<b>Requires:</b> <tt>a.size() == b.size()</tt><br>
<b>Returns:</b> A new bitset that is the set difference of the
bitsets <tt>a</tt> and <tt>b</tt>.<br>
bitsets <tt>a</tt> and <tt>b</tt>. Note that the expression
<tt>b1 - b2</tt> is equivalent to creating a temporary copy of
<tt>b1</tt>, using <tt>operator-=</tt>, and returning the
temporary copy.<br>
<b>Throws:</b> An allocation error if memory is exhausted
(<tt>std::bad_alloc</tt> if <tt>Allocator=std::allocator</tt>).
@@ -1518,12 +1576,12 @@ precise specification, given in terms of "as if" rule: first, for each
valid position i into the bitset <tt>b</tt> let's put:
<tt>character_of(b[i)]) = b[i]? os.widen('1') : os.widen('0');</tt>
Let also <tt>s</tt> be a <tt>std::basic_string&lt;Char, Traits&gt;</tt>
object, having length <tt>b.size()</tt> and such as, for each <tt>i</tt>
in <tt>[0, b.size())</tt>,
<tt>s[i] is character_of(b[i])</tt>
<tt>s[i] is character_of(b[i])</tt>
Then, the output, the effects on <tt>os</tt> and the exception behavior
is the same as outputting the object <tt>s</tt> to <tt>os</tt> (same
@@ -1564,10 +1622,10 @@ were constructed by
If <tt>bool(k)</tt> is true, it calls <tt>b.clear()</tt>
then attempts to extract characters from <tt>is</tt>. For each character c
that is a <i>bitset digit</i> the <i>corresponding bit value</i> is
appended to the less significant end of <tt>b</tt> (appending may throw).
appended to the less significant end of <tt>b</tt> (appending may throw - gps ).
If <tt>is.width()</tt> is greater than zero and smaller than <tt>b.max_size()</tt>
then the maximum number <tt>n</tt> of bits appended is <tt>is.width()</tt>;
otherwise <tt>n</tt> = <tt>b.max_size()</tt>.
otherwise <tt>n</tt> = <tt>b.max_size()</tt>.
Unless the extractor is exited via an exception, characters are extracted (and
corresponding bits appended) until any of the following occurs:<br>
@@ -1656,7 +1714,7 @@ applied to their corresponding <tt>dynamic_bitset</tt>s.
<i>General improvements</i>
<br><br>
Several optimizations to member and non-member functions and to the
nested class <tt>reference</tt>.
nested class <tt>reference</tt>.
<hr>
<h3><a name="see-also">See also</a></h3>
@@ -1684,7 +1742,7 @@ issues.</p>
<tr valign="top">
<td nowrap>Copyright &copy; 2001</td>
<td><a href="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</a>,
<td><a href="../../people/jeremy_siek.htm">Jeremy Siek</a>,
Indiana University (<a href=
"mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</a>)<br>
<a href="http://freshsources.com">Chuck Allison</a>, Senior

View File

@@ -1,26 +1,20 @@
// (C) Copyright Gennaro Prota 2002
//
// 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$
exe timing_tests
: timing_tests.cpp
exe timing_tests
: timing_tests.cpp
: <include>$(BOOST_ROOT)
;
exe example1
: example1.cpp
: <include>$(BOOST_ROOT)
;
exe example2
: example2.cpp
: <include>$(BOOST_ROOT)
;
exe example3
: example3.cpp
: <include>$(BOOST_ROOT)
;

View File

@@ -25,8 +25,6 @@
//
//
// -----------------------------------------------------------------------//
//
// $Id$
#include "boost/config.hpp"

View File

@@ -1,7 +1,7 @@
// --------------------------------------------------
//
// (C) Copyright Chuck Allison and Jeremy Siek 2001 - 2002.
// (C) Copyright Gennaro Prota 2003 - 2006.
// (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
@@ -9,9 +9,8 @@
//
// -----------------------------------------------------------
// See http://www.boost.org/libs/dynamic_bitset/ for documentation.
//
// $Revision$ $Date$ - $Name$
// See http://www.boost.org/libs/dynamic_bitset for documentation.
#ifndef BOOST_DETAIL_DYNAMIC_BITSET_HPP
#define BOOST_DETAIL_DYNAMIC_BITSET_HPP
@@ -19,6 +18,7 @@
#include <cstddef> // for std::size_t
#include "boost/config.hpp"
#include "boost/detail/workaround.hpp"
//#include "boost/static_assert.hpp" // gps
namespace boost {
@@ -35,14 +35,6 @@ namespace boost {
return static_cast<const unsigned char *>(static_cast<const void *>(p));
}
template<typename T, int amount, int width /* = default */>
struct shifter
{
static void left_shift(T & v) {
amount >= width ? (v = 0)
: (v >>= BOOST_DYNAMIC_BITSET_WRAP_CONSTANT(amount));
}
};
// ------- count function implementation --------------

View File

@@ -9,9 +9,7 @@
//
// -----------------------------------------------------------
// See http://www.boost.org/libs/dynamic_bitset/ for documentation.
//
// $Revision$ $Date$ - $Name$
// See http://www.boost.org/libs/dynamic_bitset for documentation.
#ifndef BOOST_DYNAMIC_BITSET_HPP
#define BOOST_DYNAMIC_BITSET_HPP

View File

@@ -1,7 +1,7 @@
// --------------------------------------------------
//
// (C) Copyright Chuck Allison and Jeremy Siek 2001 - 2002.
// (C) Copyright Gennaro Prota 2003 - 2006.
// (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
@@ -9,9 +9,8 @@
//
// -----------------------------------------------------------
// See http://www.boost.org/libs/dynamic_bitset/ for documentation.
//
// $Revision$ $Date$ - $Name$
// See http://www.boost.org/libs/dynamic_bitset for documentation.
#ifndef BOOST_DYNAMIC_BITSET_CONFIG_HPP_GP_20040424
#define BOOST_DYNAMIC_BITSET_CONFIG_HPP_GP_20040424
@@ -29,8 +28,8 @@
#define BOOST_DYNAMIC_BITSET_GNUC_VERSION ( __GNUC__ * 100 * 100 \
+ __GNUC_MINOR__ * 100)
// no-op function to workaround gcc bug c++/8419
//
// workaround for gcc bug c++/8419 - gps
namespace boost { namespace detail {
template <typename T> T make_non_const(T t) { return t; }
}}
@@ -49,7 +48,7 @@ namespace boost { namespace detail {
#define BOOST_DYNAMIC_BITSET_DONT_USE_FRIENDS
#endif
// if we can't use friends then we simply expose private members
// if we can't use friends then private members are exposed
//
#if defined(BOOST_DYNAMIC_BITSET_DONT_USE_FRIENDS)
#define BOOST_DYNAMIC_BITSET_PRIVATE public

View File

@@ -1,7 +1,7 @@
// --------------------------------------------------
//
// (C) Copyright Chuck Allison and Jeremy Siek 2001 - 2002.
// (C) Copyright Gennaro Prota 2003 - 2006.
// (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
@@ -9,25 +9,24 @@
//
// -----------------------------------------------------------
// See http://www.boost.org/libs/dynamic_bitset/ for documentation.
//
// $Revision$ $Date$ - $Name$
// See http://www.boost.org/libs/dynamic_bitset for documentation.
#ifndef BOOST_DYNAMIC_BITSET_DYNAMIC_BITSET_HPP
#define BOOST_DYNAMIC_BITSET_DYNAMIC_BITSET_HPP
#include <assert.h>
#include <cassert>
#include <string>
#include <stdexcept> // for std::overflow_error
#include <algorithm> // for std::swap, min, copy, fill
#include <stdexcept> // for std::overflow_error
#include <algorithm> // for std::swap, std::min, std::copy, std::fill
#include <vector>
#include <climits> // for CHAR_BIT
#include <climits> // for CHAR_BIT
#include "boost/dynamic_bitset/config.hpp"
#ifndef BOOST_NO_STD_LOCALE
# include <locale>
# include <locale> // G.P.S
#endif
#if defined(BOOST_OLD_IOSTREAMS)
@@ -69,7 +68,7 @@ public:
typedef Block block_type;
typedef Allocator allocator_type;
typedef std::size_t size_type;
typedef int block_width_type;
typedef int block_width_type; // gps
BOOST_STATIC_CONSTANT(block_width_type, bits_per_block = (std::numeric_limits<Block>::digits));
BOOST_STATIC_CONSTANT(size_type, npos = static_cast<size_type>(-1));
@@ -78,6 +77,7 @@ public:
public:
// A proxy class to simulate lvalues of bit type.
// Shouldn't it be private? [gps]
//
class reference
{
@@ -87,7 +87,7 @@ public:
// the one and only non-copy ctor
reference(block_type & b, int pos)
:m_block(b), m_mask(block_type(1) << pos)
{ assert(pos >= 0 && pos < bits_per_block); }
{}
void operator&(); // left undefined
@@ -129,16 +129,16 @@ public:
const Allocator& alloc = Allocator());
// WARNING: you should avoid using this constructor.
//
// A conversion from string is, in most cases, formatting,
// and should be performed by using operator>>.
// The presence of this constructor is a concession to ease of
// use, especially for the novice user. A conversion from string
// is, in most cases, formatting, and should be done by the standard
// formatting convention: operator>>.
//
// NOTE:
// Leave the parentheses around std::basic_string<CharT, Traits, Alloc>::npos.
// g++ 3.2 requires them and probably the standard will - see core issue 325
// NOTE 2:
// split into two constructors because of bugs in MSVC 6.0sp5 with STLport
// Leave the parentheses around std::basic_string<CharT, Traits, Alloc>::npos.
// g++ 3.2 requires them and probably the standard will - see core issue 325
// NOTE 2:
// split into two constructors because of bugs in MSVC 6.0sp5 with STLport
template <typename CharT, typename Traits, typename Alloc>
dynamic_bitset(const std::basic_string<CharT, Traits, Alloc>& s,
@@ -150,7 +150,7 @@ public:
:m_bits(alloc),
m_num_bits(0)
{
init_from_string(s, pos, n, num_bits);
init_from_string(s, pos, n, num_bits, alloc);
}
template <typename CharT, typename Traits, typename Alloc>
@@ -162,7 +162,7 @@ public:
m_num_bits(0)
{
init_from_string(s, pos, (std::basic_string<CharT, Traits, Alloc>::npos),
npos);
npos, Allocator());
}
// The first bit in *first is the least significant bit, and the
@@ -264,6 +264,10 @@ public:
size_type num_blocks() const;
size_type max_size() const;
bool empty() const;
#if 0 // gps
void reserve(size_type n);
size_type capacity() const;
#endif
bool is_subset_of(const dynamic_bitset& a) const;
bool is_proper_subset_of(const dynamic_bitset& a) const;
@@ -323,14 +327,15 @@ private:
void init_from_string(const std::basic_string<CharT, Traits, Alloc>& s,
typename std::basic_string<CharT, Traits, Alloc>::size_type pos,
typename std::basic_string<CharT, Traits, Alloc>::size_type n,
size_type num_bits)
size_type num_bits,
const Allocator& alloc)
{
assert(pos <= s.size());
typedef typename std::basic_string<CharT, Traits, Alloc> StrT;
typedef typename StrT::traits_type Tr;
const typename StrT::size_type rlen = (std::min)(n, s.size() - pos);
const typename StrT::size_type rlen = (std::min)(n, s.size() - pos); // gps
const size_type sz = ( num_bits != npos? num_bits : rlen);
m_bits.resize(calc_num_blocks(sz));
m_num_bits = sz;
@@ -339,7 +344,7 @@ private:
BOOST_DYNAMIC_BITSET_CTYPE_FACET(CharT, fac, std::locale());
const CharT one = BOOST_DYNAMIC_BITSET_WIDEN_CHAR(fac, '1');
const size_type m = num_bits < rlen ? num_bits : rlen;
const size_type m = num_bits < rlen ? num_bits : rlen; // [gps]
typename StrT::size_type i = 0;
for( ; i < m; ++i) {
@@ -363,7 +368,7 @@ BOOST_DYNAMIC_BITSET_PRIVATE:
Block& m_highest_block();
const Block& m_highest_block() const;
buffer_type m_bits;
buffer_type m_bits; // [gps] to be renamed
size_type m_num_bits;
@@ -373,11 +378,10 @@ BOOST_DYNAMIC_BITSET_PRIVATE:
// helper for stream >>
// Supplies to the lack of an efficient append at the less
// significant end: bits are actually appended "at left" but
// rearranged in the destructor. From the perspective of
// client code everything works *as if* dynamic_bitset<> had
// an append_at_right() function (eventually throwing the same
// exceptions as push_back) except that the function is in fact
// called bit_appender::do_append().
// rearranged in the destructor. Everything works just as if
// dynamic_bitset<> had an append_at_right() function (which
// threw, in case, the same exceptions as push_back) except
// that the function is actually called bit_appender::do_append().
//
dynamic_bitset & bs;
size_type n;
@@ -415,28 +419,6 @@ BOOST_DYNAMIC_BITSET_PRIVATE:
};
#if defined(__IBMCPP__) && BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
// 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
dynamic_bitset<Block, Allocator>::bits_per_block;
template<typename Block, typename Allocator>
dynamic_bitset<Block, Allocator>::block_width_type const
dynamic_bitset<Block, Allocator>::ulong_width;
#endif
// Global Functions:
// comparison
@@ -505,7 +487,7 @@ void swap(dynamic_bitset<Block, Allocator>& b1,
template <typename Block, typename Allocator, typename stringT>
void
to_string(const dynamic_bitset<Block, Allocator>& b, stringT & s);
to_string(const dynamic_bitset<Block, Allocator>& b, stringT & s); // gps
template <typename Block, typename Allocator, typename BlockOutputIterator>
void
@@ -513,13 +495,15 @@ to_block_range(const dynamic_bitset<Block, Allocator>& b,
BlockOutputIterator result);
// gps - check docs with Jeremy
//
template <typename BlockIterator, typename B, typename A>
inline void
from_block_range(BlockIterator first, BlockIterator last,
dynamic_bitset<B, A>& result)
{
// PRE: distance(first, last) <= numblocks()
std::copy (first, last, result.m_bits.begin());
std::copy (first, last, result.m_bits.begin()); //[gps]
}
//=============================================================================
@@ -543,22 +527,26 @@ dynamic_bitset(size_type num_bits, unsigned long value, const Allocator& alloc)
m_num_bits(num_bits)
{
if (num_bits == 0)
return;
typedef unsigned long num_type;
typedef boost::detail::shifter<num_type, bits_per_block, ulong_width> shifter;
//if (num_bits == 0)
// return;
// zero out all bits at pos >= num_bits, if any;
// note that: num_bits == 0 implies value == 0
// cut off all bits in value that have pos >= num_bits, if any
if (num_bits < static_cast<size_type>(ulong_width)) {
const num_type mask = (num_type(1) << num_bits) - 1;
value &= mask;
}
typename buffer_type::iterator it = m_bits.begin();
for( ; value; shifter::left_shift(value), ++it) {
*it = static_cast<block_type>(value);
if (bits_per_block >= ulong_width) {
m_bits[0] = static_cast<block_type>(value);
}
else {
for(size_type i = 0; value != 0; ++i) {
m_bits[i] = static_cast<block_type>(value);
value >>= BOOST_DYNAMIC_BITSET_WRAP_CONSTANT(bits_per_block);
}
}
}
@@ -567,7 +555,7 @@ dynamic_bitset(size_type num_bits, unsigned long value, const Allocator& alloc)
template <typename Block, typename Allocator>
inline dynamic_bitset<Block, Allocator>::
dynamic_bitset(const dynamic_bitset& b)
: m_bits(b.m_bits), m_num_bits(b.m_num_bits)
: m_bits(b.m_bits), m_num_bits(b.m_num_bits) // [gps]
{
}
@@ -591,9 +579,15 @@ template <typename Block, typename Allocator>
dynamic_bitset<Block, Allocator>& dynamic_bitset<Block, Allocator>::
operator=(const dynamic_bitset<Block, Allocator>& b)
{
#if 0 // gps
dynamic_bitset<Block, Allocator> tmp(b);
this->swap(tmp);
return *this;
#else
m_bits = b.m_bits;
m_num_bits = b.m_num_bits;
return *this;
#endif
}
template <typename Block, typename Allocator>
@@ -617,32 +611,34 @@ resize(size_type num_bits, bool value) // strong guarantee
const block_type v = value? ~Block(0) : Block(0);
if (required_blocks != old_num_blocks) {
m_bits.resize(required_blocks, v); // s.g. (copy)
m_bits.resize(required_blocks, v); // s.g. (copy) [gps]
}
// At this point:
//
// - if the buffer was shrunk, we have nothing more to do,
// except a call to m_zero_unused_bits()
// - if the buffer was shrunk, there's nothing to do, except
// a call to m_zero_unused_bits()
//
// - if it was enlarged, all the (used) bits in the new blocks have
// the correct value, but we have not yet touched those bits, if
// any, that were 'unused bits' before enlarging: if value == true,
// - if it it is enlarged, all the (used) bits in the new blocks have
// the correct value, but we should also take care of the bits,
// if any, that were 'unused bits' before enlarging: if value == true,
// they must be set.
if (value && (num_bits > m_num_bits)) {
const size_type extra_bits = count_extra_bits();
const size_type extra_bits = count_extra_bits(); // gps
if (extra_bits) {
assert(old_num_blocks >= 1 && old_num_blocks <= m_bits.size());
// Set them.
m_bits[old_num_blocks - 1] |= (v << extra_bits);
m_bits[old_num_blocks - 1] |= (v << extra_bits); // gps
}
}
m_num_bits = num_bits;
m_zero_unused_bits();
@@ -661,15 +657,16 @@ template <typename Block, typename Allocator>
void dynamic_bitset<Block, Allocator>::
push_back(bool bit)
{
const size_type sz = size();
resize(sz + 1);
set(sz, bit);
resize(size() + 1);
set(size() - 1, bit);
}
template <typename Block, typename Allocator>
void dynamic_bitset<Block, Allocator>::
append(Block value) // strong guarantee
{
// G.P.S. to be reviewed...
const block_width_type r = count_extra_bits();
if (r == 0) {
@@ -769,23 +766,10 @@ dynamic_bitset<Block, Allocator>::operator<<=(size_type n)
b[div] = b[0];
}
// disable std::fill_n deprecated warning in MSVC++ 8.0 (warning C4996)
// This will only work in MSVC++ 8.0 SP1, which brings up the warning
// in the line of user code; otherwise, the warning will come up
// in the line in the header itself, so if the user includes stdlib
// headers before dynamic_bitset, he will still get the warning.
#if defined(_MSC_VER) && _MSC_VER >= 1400
#pragma warning(push)
#pragma warning(disable:4996)
#endif
// zero out div blocks at the less significant end
std::fill_n(b, div, static_cast<block_type>(0));
#if defined(_MSC_VER) && _MSC_VER >= 1400
#pragma warning(pop)
#endif
// zero out any 1 bit that flowed into the unused part
m_zero_unused_bits(); // thanks to Lester Gong
@@ -869,6 +853,13 @@ template <typename Block, typename Allocator>
dynamic_bitset<Block, Allocator>&
dynamic_bitset<Block, Allocator>::set(size_type pos, bool val)
{
// [gps]
//
// Below we have no set(size_type) function to call when
// value == true; instead of using a helper, I think
// overloading set (rather than giving it a default bool
// argument) would be more elegant.
assert(pos < m_num_bits);
if (val)
@@ -893,14 +884,14 @@ dynamic_bitset<Block, Allocator>&
dynamic_bitset<Block, Allocator>::reset(size_type pos)
{
assert(pos < m_num_bits);
#if defined __MWERKS__ && BOOST_WORKAROUND(__MWERKS__, <= 0x3003) // 8.x
#if BOOST_WORKAROUND(__MWERKS__, <= 0x3003) // 8.x
// CodeWarrior 8 generates incorrect code when the &=~ is compiled,
// use the |^ variation instead.. <grafik>
m_bits[block_index(pos)] |= bit_mask(pos);
m_bits[block_index(pos)] ^= bit_mask(pos);
#else
#else
m_bits[block_index(pos)] &= ~bit_mask(pos);
#endif
#endif
return *this;
}
@@ -969,6 +960,45 @@ dynamic_bitset<Block, Allocator>::operator~() const
}
/*
The following is the straightforward implementation of count(), which
we leave here in a comment for documentation purposes.
template <typename Block, typename Allocator>
typename dynamic_bitset<Block, Allocator>::size_type
dynamic_bitset<Block, Allocator>::count() const
{
size_type sum = 0;
for (size_type i = 0; i != this->m_num_bits; ++i)
if (test(i))
++sum;
return sum;
}
The actual algorithm uses a lookup table.
The basic idea of the method is to pick up X bits at a time
from the internal array of blocks and consider those bits as
the binary representation of a number N. Then, to use a table
of 1<<X elements where table[N] is the number of '1' digits
in the binary representation of N (i.e. in our X bits).
In this implementation X is 8 (but can be easily changed: you
just have to modify the definition of table_width and shrink/enlarge
the table accordingly - it could be useful, for instance, to expand
the table to 512 elements on an implementation with 9-bit bytes) and
the internal array of blocks is seen, if possible, as an array of bytes.
In practice the "reinterpretation" as array of bytes is possible if and
only if X >= CHAR_BIT and Block has no padding bits (that would be counted
together with the "real ones" if we saw the array as array of bytes).
Otherwise we simply 'extract' X bits at a time from each Block.
*/
template <typename Block, typename Allocator>
typename dynamic_bitset<Block, Allocator>::size_type
dynamic_bitset<Block, Allocator>::count() const
@@ -1025,7 +1055,7 @@ void to_string_helper(const dynamic_bitset<B, A> & b, stringT & s,
// making me (Gennaro) realize this important separation of
// concerns issue, as well as many things about i18n.
//
template <typename Block, typename Allocator, typename stringT>
template <typename Block, typename Allocator, typename stringT> // G.P.S.
inline void
to_string(const dynamic_bitset<Block, Allocator>& b, stringT& s)
{
@@ -1039,7 +1069,7 @@ to_string(const dynamic_bitset<Block, Allocator>& b, stringT& s)
//
template <typename B, typename A, typename stringT>
inline void
dump_to_string(const dynamic_bitset<B, A>& b, stringT& s)
dump_to_string(const dynamic_bitset<B, A>& b, stringT& s) // G.P.S.
{
to_string_helper(b, s, true /* =dump_all*/);
}
@@ -1051,7 +1081,7 @@ to_block_range(const dynamic_bitset<Block, Allocator>& b,
{
// note how this copies *all* bits, including the
// unused ones in the last block (which are zero)
std::copy(b.m_bits.begin(), b.m_bits.end(), result);
std::copy(b.m_bits.begin(), b.m_bits.end(), result); // [gps]
}
template <typename Block, typename Allocator>
@@ -1068,30 +1098,26 @@ to_ulong() const
throw std::overflow_error("boost::dynamic_bitset::to_ulong overflow");
// Ok, from now on we can be sure there's no "on" bit
// beyond the "allowed" positions
typedef unsigned long result_type;
// Ok, from now on we can be sure there's no "on" bit beyond
// the allowed positions
/*
if find_next() did its job correctly we don't need the if
below, because all bits we care about are in the first block
if (bits_per_block >= ulong_width)
return m_bits[0];
if (bits_per_block >= ulong_width)
return static_cast<result_type>(m_bits[0]);
*/
size_type last_block = block_index(
(std::min)( m_num_bits, (size_type)ulong_width ) - 1 );
result_type result = 0;
size_type last_block = block_index((std::min)(m_num_bits-1, // gps
(size_type)(ulong_width-1)));
unsigned long result = 0;
for (size_type i = 0; i <= last_block; ++i) {
assert((size_type)bits_per_block * i < (size_type)ulong_width);
assert((size_type)bits_per_block * i < (size_type)ulong_width); // gps
unsigned long piece = m_bits[i];
result |= (piece << (bits_per_block * i));
}
return result;
}
@@ -1136,6 +1162,31 @@ inline bool dynamic_bitset<Block, Allocator>::empty() const
return size() == 0;
}
#if 0 // gps
template <typename Block, typename Allocator>
inline void dynamic_bitset<Block, Allocator>::reserve(size_type n)
{
assert(n <= max_size()); // PRE - G.P.S.
m_bits.reserve(calc_num_blocks(n));
}
template <typename Block, typename Allocator>
typename dynamic_bitset<Block, Allocator>::size_type
dynamic_bitset<Block, Allocator>::capacity() const
{
// capacity is m_bits.capacity() * bits_per_block
// unless that one overflows
const size_type m = static_cast<size_type>(-1);
const size_type q = m / bits_per_block;
const size_type c = m_bits.capacity();
return c <= q ?
c * bits_per_block :
m;
}
#endif
template <typename Block, typename Allocator>
bool dynamic_bitset<Block, Allocator>::
is_subset_of(const dynamic_bitset<Block, Allocator>& a) const
@@ -1152,17 +1203,13 @@ bool dynamic_bitset<Block, Allocator>::
is_proper_subset_of(const dynamic_bitset<Block, Allocator>& a) const
{
assert(size() == a.size());
assert(num_blocks() == a.num_blocks());
bool proper = false;
for (size_type i = 0; i < num_blocks(); ++i) {
const Block & bt = m_bits[i];
const Block & ba = a.m_bits[i];
if (bt & ~ba)
return false; // not a subset at all
Block bt = m_bits[i], ba = a.m_bits[i];
if (ba & ~bt)
proper = true;
if (bt & ~ba)
return false;
}
return proper;
}
@@ -1247,7 +1294,7 @@ bool operator==(const dynamic_bitset<Block, Allocator>& a,
const dynamic_bitset<Block, Allocator>& b)
{
return (a.m_num_bits == b.m_num_bits)
&& (a.m_bits == b.m_bits);
&& (a.m_bits == b.m_bits); // [gps]
}
template <typename Block, typename Allocator>
@@ -1264,20 +1311,23 @@ bool operator<(const dynamic_bitset<Block, Allocator>& a,
assert(a.size() == b.size());
typedef typename dynamic_bitset<Block, Allocator>::size_type size_type;
//if (a.size() == 0)
// return false;
if (a.size() == 0)
return false;
// Since we are storing the most significant bit
// at pos == size() - 1, we need to do the comparisons in reverse.
//
for (size_type ii = a.num_blocks(); ii > 0; --ii) {
size_type i = ii-1;
// Compare a block at a time
for (size_type i = a.num_blocks() - 1; i > 0; --i)
if (a.m_bits[i] < b.m_bits[i])
return true;
else if (a.m_bits[i] > b.m_bits[i])
return false;
}
return false;
if (a.m_bits[0] < b.m_bits[0])
return true;
else
return false;
}
template <typename Block, typename Allocator>
@@ -1319,7 +1369,7 @@ operator<<(std::ostream& os, const dynamic_bitset<Block, Alloc>& b)
const ios::iostate ok = ios::goodbit;
ios::iostate err = ok;
if (os.opfx()) {
if (os.opfx()) { // gps
//try
typedef typename dynamic_bitset<Block, Alloc>::size_type bitsetsize_type;
@@ -1327,7 +1377,7 @@ operator<<(std::ostream& os, const dynamic_bitset<Block, Alloc>& b)
const bitsetsize_type sz = b.size();
std::streambuf * buf = os.rdbuf();
size_t npad = os.width() <= 0 // careful: os.width() is signed (and can be < 0)
|| (bitsetsize_type) os.width() <= sz? 0 : os.width() - sz;
|| (bitsetsize_type) os.width() <= sz? 0 : os.width() - sz; //- gps
const char fill_char = os.fill();
const ios::fmtflags adjustfield = os.flags() & ios::adjustfield;
@@ -1336,16 +1386,16 @@ operator<<(std::ostream& os, const dynamic_bitset<Block, Alloc>& b)
if (adjustfield != ios::left) {
for (; 0 < npad; --npad)
if (fill_char != buf->sputc(fill_char)) {
err |= ios::failbit;
err |= ios::failbit; // gps
break;
}
}
if (err == ok) {
// output the bitset
for (bitsetsize_type i = b.size(); 0 < i; --i) {
for (bitsetsize_type i = b.size(); 0 < i; --i) {// G.P.S.
const char dig = b.test(i-1)? '1' : '0';
if (EOF == buf->sputc(dig)) {
if (EOF == buf->sputc(dig)) { // ok?? gps
err |= ios::failbit;
break;
}
@@ -1368,7 +1418,7 @@ operator<<(std::ostream& os, const dynamic_bitset<Block, Alloc>& b)
} // if opfx
if(err != ok)
os.setstate(err); // assume this does NOT throw
os.setstate(err); // assume this does NOT throw - gps
return os;
}
@@ -1395,11 +1445,11 @@ operator<<(std::basic_ostream<Ch, Tr>& os,
try {
typedef typename dynamic_bitset<Block, Alloc>::size_type bitsetsize_type;
typedef basic_streambuf<Ch, Tr> buffer_type;
typedef basic_streambuf<Ch, Tr> buffer_type; // G.P.S.
buffer_type * buf = os.rdbuf();
size_t npad = os.width() <= 0 // careful: os.width() is signed (and can be < 0)
|| (bitsetsize_type) os.width() <= b.size()? 0 : os.width() - b.size();
|| (bitsetsize_type) os.width() <= b.size()? 0 : os.width() - b.size(); //- G.P.S.
const Ch fill_char = os.fill();
const ios_base::fmtflags adjustfield = os.flags() & ios_base::adjustfield;
@@ -1408,14 +1458,14 @@ operator<<(std::basic_ostream<Ch, Tr>& os,
if (adjustfield != ios_base::left) {
for (; 0 < npad; --npad)
if (Tr::eq_int_type(Tr::eof(), buf->sputc(fill_char))) {
err |= ios_base::failbit;
err |= ios_base::failbit; // G.P.S.
break;
}
}
if (err == ok) {
// output the bitset
for (bitsetsize_type i = b.size(); 0 < i; --i) {
for (bitsetsize_type i = b.size(); 0 < i; --i) {// G.P.S.
typename buffer_type::int_type
ret = buf->sputc(b.test(i-1)? one : zero);
if (Tr::eq_int_type(Tr::eof(), ret)) {
@@ -1457,8 +1507,8 @@ operator<<(std::basic_ostream<Ch, Tr>& os,
#ifdef BOOST_OLD_IOSTREAMS
// A sentry-like class that calls isfx in its destructor.
// "Necessary" because bit_appender::do_append may throw.
// gps - A sentry-like class that calls isfx in its
// destructor. Necessary because bit_appender::do_append may throw.
class pseudo_sentry {
std::istream & m_r;
const bool m_ok;
@@ -1482,21 +1532,21 @@ operator>>(std::istream& is, dynamic_bitset<Block, Alloc>& b)
typedef dynamic_bitset<Block, Alloc> bitset_type;
typedef typename bitset_type::size_type size_type;
std::ios::iostate err = std::ios::goodbit;
std::ios::iostate err = std::ios::goodbit; // gps
pseudo_sentry cerberos(is); // skips whitespaces
if(cerberos) {
b.clear();
const std::streamsize w = is.width();
const size_type limit = w > 0 && static_cast<size_type>(w) < b.max_size()
const size_type limit = w > 0 && static_cast<size_type>(w) < b.max_size()// gps
? w : b.max_size();
typename bitset_type::bit_appender appender(b);
std::streambuf * buf = is.rdbuf();
for(int c = buf->sgetc(); appender.get_count() < limit; c = buf->snextc() ) {
if (c == EOF) {
err |= std::ios::eofbit;
err |= std::ios::eofbit; // G.P.S.
break;
}
else if (char(c) != '0' && char(c) != '1')
@@ -1504,6 +1554,7 @@ operator>>(std::istream& is, dynamic_bitset<Block, Alloc>& b)
else {
try {
//throw std::bad_alloc(); // gps
appender.do_append(char(c) == '1');
}
catch(...) {
@@ -1515,10 +1566,10 @@ operator>>(std::istream& is, dynamic_bitset<Block, Alloc>& b)
} // for
}
is.width(0);
is.width(0); // gps
if (b.size() == 0)
err |= std::ios::failbit;
if (err != std::ios::goodbit)
if (err != std::ios::goodbit) // gps
is.setstate (err); // may throw
return is;
@@ -1537,10 +1588,10 @@ operator>>(std::basic_istream<Ch, Tr>& is, dynamic_bitset<Block, Alloc>& b)
typedef typename bitset_type::size_type size_type;
const streamsize w = is.width();
const size_type limit = 0 < w && static_cast<size_type>(w) < b.max_size()?
const size_type limit = 0 < w && static_cast<size_type>(w) < b.max_size()? // gps
w : b.max_size();
ios_base::iostate err = ios_base::goodbit;
ios_base::iostate err = ios_base::goodbit; // gps
typename basic_istream<Ch, Tr>::sentry cerberos(is); // skips whitespaces
if(cerberos) {
@@ -1553,11 +1604,11 @@ operator>>(std::basic_istream<Ch, Tr>& is, dynamic_bitset<Block, Alloc>& b)
try {
typename bitset_type::bit_appender appender(b);
basic_streambuf <Ch, Tr> * buf = is.rdbuf();
typename Tr::int_type c = buf->sgetc();
typename Tr::int_type c = buf->sgetc(); // G.P.S.
for( ; appender.get_count() < limit; c = buf->snextc() ) {
if (Tr::eq_int_type(Tr::eof(), c)) {
err |= ios_base::eofbit;
err |= ios_base::eofbit; // G.P.S.
break;
}
else {
@@ -1578,7 +1629,7 @@ operator>>(std::basic_istream<Ch, Tr>& is, dynamic_bitset<Block, Alloc>& b)
//
// bits_stored bits have been extracted and stored, and
// either no further character is extractable or we can't
// append to the underlying vector (out of memory)
// append to the underlying vector (out of memory) gps
bool rethrow = false; // see std 27.6.1.1/4
try { is.setstate(ios_base::badbit); }
@@ -1590,10 +1641,10 @@ operator>>(std::basic_istream<Ch, Tr>& is, dynamic_bitset<Block, Alloc>& b)
}
}
is.width(0);
is.width(0); // gps
if (b.size() == 0 /*|| !cerberos*/)
err |= ios_base::failbit;
if (err != ios_base::goodbit)
if (err != ios_base::goodbit) // gps
is.setstate (err); // may throw
return is;
@@ -1651,7 +1702,7 @@ inline void
swap(dynamic_bitset<Block, Allocator>& left,
dynamic_bitset<Block, Allocator>& right) // no throw
{
left.swap(right);
left.swap(right); // gps
}

View File

@@ -9,9 +9,8 @@
//
// -----------------------------------------------------------
// See http://www.boost.org/libs/dynamic_bitset/ for documentation.
//
// $Revision$ $Date$ - $Name$
// See http://www.boost.org/libs/dynamic_bitset for documentation.
#ifndef BOOST_DYNAMIC_BITSET_FWD_HPP
#define BOOST_DYNAMIC_BITSET_FWD_HPP

View File

@@ -10,13 +10,11 @@
// http://www.boost.org/LICENSE_1_0.txt)
//
// ------------------------------------------------------
//
// $Id$
#ifndef BOOST_LOWEST_BIT_HPP_GP_20030301
#define BOOST_LOWEST_BIT_HPP_GP_20030301
#include <assert.h>
#include <cassert>
#include "boost/pending/integer_log2.hpp"

View File

@@ -1,15 +1,9 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv=refresh content="0; URL=dynamic_bitset.html">
<title>Automatic redirection</title>
<meta http-equiv="refresh" content="0; URL=dynamic_bitset.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="dynamic_bitset.html">dynamic_bitset.html</a>.&nbsp;<hr>
<p>© Copyright Beman Dawes, 2001</p>
<p>Distributed under the Boost Software License, Version 1.0. (See accompanying
file <a href="../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or copy
at <a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</p>
<a href="dynamic_bitset.html">dynamic_bitset.html</a>.
</body>
</html>