On 04/09/2017 17:12, Phil Endecott via Boost wrote:
Dear all,
boost::container::small_vector and boost::container::static_vector are great. boost::container::flat_set is great too.
But today I need a small_flat_set! And I don't think it's possible to compose flat_set and small_vector. (flat_set can use a custom allocator, but it can't take a custom implementation type in the way that, for example, std::priority_queue can.)
Having said that, maybe composing flat_set and small_vector (or static_vector) isn't the optimum solution for the case where I will store something like 0...4 ints; I suspect that linear search in an unordered sequence will be quicker. But that gets complicated if you need iterators with the normal behaviour.
Any thoughts?
I recently committed to develop the initial implementation (not properly
tested!) to use a different container than boost::container::vector as
the underlying sequence. The idea is to pass a container instead of an
allocator:
flat_set