
On Oct 25, 2013, at 2:00 PM, Nevin Liber
On 24 October 2013 17:10, Rob Stewart
wrote: I meant that stack allocated memory could be used if std::array's interface satisfies the needs of flat_*. std::array can be one choice among many.
I'm not seeing how a container of exactly N elements would be useful as a backing store for flat_xxx. Could you show an example?
I was just thinking of a use case in which a map is needed, but memory is constrained or preallocated. I was also just showing how permitting user-specified containers opens possibilities. 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. ___ Rob (Sent from my portable computation engine)