Boost logo

Boost :

Subject: Re: [boost] Proposal: Monotonic Containers
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2009-06-09 08:17:21


>
> can you motivate why the proposal are adding a new set of containers
> instead
> > of only an allocator to be used with the standard containers?
>
> Because the container constructors need to be passed the storage. The
> container implementations are trivial.
>

I think you can omit the containers if you just expect the programmer to
explicitly construct the them over the storage_base. For example (I'm
abbreviating monotonic):

typedef std::vector<T, mono::allocator<T> > Vector;
Vector v(mono::allocator<T>(store));

It' may appear be as graceful, but it doesn't require the duplication of
classes, which can be harmful. There are libraries in Boost that specialize
(templates) on containers types, and new containers would likely fail the
specializations.

Andrew Sutton
andrew.n.sutton_at_[hidden]


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