Should the complexity of std::list::size() be O(n) or O(1)?

Jonathan Wakely jwakely.gcc@gmail.com
Tue Nov 29 14:23:00 GMT 2005


On 11/29/05, Peter Dimov <pdimov@mmltd.net> wrote:

> If all containers that keep their elements in a contiguous block of memory
> (std::vector, std::string, std::valarray, user-defined array, string, matrix

Sorry for going off on a tangent, but does the standard actually
require contiguous storage for std::string?  I was under the
impression it used to implicitly require it, until lib DR259 was
resolved.  Can anyone set me straight?

jon



More information about the Libstdc++ mailing list