Boost logo

Boost :

From: Chuck Allison (cda_at_[hidden])
Date: 2001-11-26 00:49:02


One consideration, which seemed important at the time, was that bitset could
be stack-based for efficiency. It seems difficult to do that for a
one-size-fits-all class like you're suggesting (although I'm sure there's an
Alexandrescu-like approach to solve the problem.)

----- Original Message -----
From: "Matt Austern" <austern_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Sunday, November 25, 2001 10:27 PM
Subject: Re: [boost] Dynamic sized bitset

> Jeremy Siek wrote:
> >
> > About 6 months ago I did an implementation of dynamic and static bitset
> > classes where almost all of the functionality was factored into a common
> > base class. That could be easily converted into a single class with a
policy
> > parameter. However, I did not bring that up when talking with Chuck, or
for
> > submission to Boost, because the C++ standard already has std::bitset,
and I
> > thought it would be simpler to have something that is a pure addition
> > instead of something that replaces what's already there and then also
makes
> > an extension. Does that make sense?
>
> Actually, I have a slightly different question. (I think I brought this
> up when we talked about this in Redmond.)
>
> My question: why do we need both bitset<> and vector<bool>? What are
> the real differences?
>
> Except for trivial syntactic issues, here's all I can really come up
> with:
> - vector<bool> provides STL iterators and dynamic resizing, and
> bitset doesn't.
> - bitset provides conversion to/from long, simple I/O, and
> bitwise operations. vector<bool> doesn't provide any of
> those things.
>
> Seems to me that we should really be looking at extending vector<bool>,
> not extending bitset. A few trivial addons to vector<bool>, and we've
> got a class that does everything bitset does and more. (Yeah, I know:
> vector<bool> shouldn't be spelled vector<bool>, it should be spelled
> bit_vector. Details.)
>
> --Matt
>
> Info: http://www.boost.org Unsubscribe:
<mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk