Boost logo

Boost :

Subject: Re: [boost] Stack-based vector container
From: Stephan T. Lavavej (stl_at_[hidden])
Date: 2011-01-22 23:11:27

[Emil Dotchevski]
> std::vector is allowed to be stack-based when possible.

STL containers must support O(1), nofail, non-iterator-invalidating swaps*. According to my understanding, this forbids a "Small Vector Optimization", if not in theory then in practice (i.e. without compromising performance elsewhere).

(* With a few exceptions, like for std::string's Small String Optimization, and for end iterators to permit container-internal sentinel nodes.)

Boost list run by bdawes at, gregod at, cpdaniel at, john at