|
Boost : |
From: Jens Maurer (Jens.Maurer_at_[hidden])
Date: 2001-12-31 14:41:55
(I'm a bit late here, but anyway...)
Beman Dawes wrote:>
> Unification of bitset, dyn_bitset, and vector<bool> seems within reach, and
> seems like an elegant solution to several issues:
>
> * A replacement for vector<bool> which does meet container requirements.
> * bitset isn't an STL container.
> * bitset users wish both static and dynamic allocation flavors.
I'm all for unifying the *interfaces* of bitset and dyn_bitset.
People here seem to think about a single, unified uni_bitset class
with a policy template parameter to select between compile-time and
runtime allocation. I think this needlessly complicates the issue.
You can almost never use a class with a policy template parameter
without looking up the docs first (i.e. policy parameters provide more
flexibility at a non-negligible cost of ease of use).
Some function that wishes to use a bitset-like object
in some non-size-modifying fashion needs to be a template anyway,
either on the policy class (single, unified bitset class) or on
the whole bitset-like class (two distinct classes: bitset and dyn_bitset).
In short, I don't see a reason for a unified, single
merged class for bitset and dyn_bitset.
Btw, the stack vs. heap allocation choice seems to be mostly a
quality-of-implementation issue.
(I'm keeping away from the vector<bool> issue for now.)
Jens Maurer
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk