
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