|
Boost : |
From: Andrei Alexandrescu (andrewalex_at_[hidden])
Date: 2001-11-26 00:55:11
> 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.)
Thanks but you're giving me way too much credit. I think it's a straight
policy passed as a template argument. Then the policy has two
implementations: one that uses straight allocation and one that uses dynamic
allocation. The functions for dynamic growth will return errors or will not
compile at all (if called) for the non-dynamic implementation. It's that
easy.
Andrei
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk