Boost logo

Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2004-04-15 14:30:49

On Apr 14, 2004, at 8:12 AM, David Abrahams wrote:
> Not at all. This is not a std::set<> after all. It's well known that
> it has the semantics of an array. But maybe you should rename it
> bit_array or bit_vector instead of dynamic_bitset ;-)

Well, it's not entirely that clear cut. dynamic_bitset does have
many aspects of a "set", in addition to many aspects of a container.
 From the docs:

> The main problem that dynamic_bitset is designed to solve is that
> of representing a subset of a finite set. Each bit represents
> whether an element of the finite set is in the subset or not. As
> such the bitwise operations of dynamic_bitset, such as operator&
> and operator|, correspond to set operations, such as intersection
> and union.

dynamic_bitset is admittedly a little schizophrenic, which is
due to inheriting its design from std::bitset. However, I don't think
migrating far away from std::bitset is a good idea. If one wants a
"pure" set
interface, one can come up with a concept for a "set" and then
add a layer that makes dynamic_bitset conform to that concept.
Along these lines, one could have a free "empty_set" function.

In short, I think empty() should not change, but only because that
would also confuse users: users who are switching from std::bitset
to dynamic_bitset.


Jeremy Siek <jsiek_at_[hidden]>
Ph.D. Student, Indiana University Bloomington
Graduating in August 2004 and looking for work
C++ Booster (

Boost list run by bdawes at, gregod at, cpdaniel at, john at