|
Boost : |
Subject: Re: [boost] Stack-based vector container
From: Frank Mori Hess (fmhess_at_[hidden])
Date: 2010-12-28 23:41:39
On Tuesday 28 December 2010, Howard Hinnant wrote:
> > Yeah, an allocator with some internal storage that falls back to the
> > heap when it's exausted would allow std::vector's to essentially use
> > the "small string optimization."
>
> For example:
>
> http://home.roadrunner.com/~hinnant/stack_alloc.html
That page talks about the allocator working with c++03 containers, but what
about 20.1.5 paragraph 4? Quote:
"Implementations of containers described in this International Standard are
permitted to assume that their
Allocator template parameter meets the following two additional
requirements beyond those in Table 32.
â All instances of a given allocator type are required to be
interchangeable and always compare equal to
each other..."
And then I also see there is an allocator copy constructor postcondition
which it does not fulfill:
X a(b); post: Y(a) == b
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk