
On Dec 28, 2010, at 11:41 PM, Frank Mori Hess wrote:
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:
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
I've changed my documentation to make it clear that the C++03 compatibility part of the design is based on actual C++03 implementations of standard containers as opposed to strictly following the C++03 specification. -Howard