News for hackers. Stuff that matters.
Re:JSON for Modern C++ version 3.10.0 by adzm on Thursday August 19, 2021 @08:08AM (#28232775)
> BTW, for very small numbers of items the most efficient solution is often a plain std::vector + linear search.

This is why flat_map is a great solution. It's basically an ordered vector with a map-like interface, but without the memory allocation (and cache locality issues) for each node. Until you start getting into thousands of elements it is probably the best choice of container.

There are no comments on this comment yet.