From: Neil Groves (neil_at_[hidden])
Date: 2008-01-21 09:13:59
You are correct.
The default capacity would be better as 0. I had misunderstood the default
On Jan 21, 2008 1:32 PM, Thorsten Ottosen <thorsten.ottosen_at_[hidden]>
> Neil Groves skrev:
> > I am happy that you are not suggesting allocation in the push operation.
> > I think that requiring a call to reserve() is surprising behaviour since
> > would have to call reserve() for the container to work. This is
> > with the standard containers in a different manner. I have always wanted
> > circular_buffer uses to be allocated at full size.
> But isn't that 2^32 objects (i.e. *huge*)? (Or am I misunderstanding
> > Perhaps the default
> > behaviour could remain the same but an additional constructor could be
> > provided to avoid allocation during construction?
> Hm. I don't know. There is a lot of existing code that relies on cheap
> default construction, e.g.:
> std::map<int,circular_buffer<T>> map;
> map[ 1 ] = circular_buffer<T>(...);
> Unsubscribe & other changes:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk