On 28 October 2013 09:04, Rob Stewart wrote:
On Oct 27, 2013, at 8:32 AM, Jonathan Wakely
wrote: On 25 October 2013 20:44, Rob Stewart wrote:
A flat_map, backed by std::array, is quite possibly no faster than a normal C++11 map, with a suitable allocator. A C++03 map won't use its allocator for nodes, but IIRC, a C++11 map will.
What do you mean by "use"?
std::map has always allocated the memory for its nodes using its allocator.
03's allocator interface means that the element and node allocations were done via different allocator types, which leads to distinct allocations. I don't recall the details, but that prevents using the same memory for both, as I recall.
You're mistaken. The element has always been embedded in the node, so only the node is allocated.