Boost C++ Libraries: Ticket #11244: A version of vector optimized for the empty case https://svn.boost.org/trac10/ticket/11244 <p> Hello, </p> <p> it would be useful if boost could provide a version of vector optimized for the case where the vector is empty. In particular, sizeof(vector)==sizeof(void*) with no allocation in the empty case. The size and capacity can be stored in the allocated region when that region exists. This technique can be seen in mozilla's nsTArray, libstdc++'s std::string (before the new ABI in gcc-5) and several other places. Like mozilla, I would like to use this in a tree-like structure, and a large proportion of the nodes are leaves with an empty vector, where 2 pointers make a noticable difference. To be precise, I would actually want a flat_set with a map-like interface (the key can be deduced from the value), but a vector would be a good start. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11244 Trac 1.4.3