dimanche 1 octobre 2017

Preserving insertion_order on a std::set

Before marking this as duplicate, I have been here, here, and here, a duplicate of the first.

I'm aware of boost::multi_index, and use an environment where I lack it, and that a std::unordered_set is not bound to store elements in a deterministic insertion order.

I find the concept of using two containers, say an additional std::vector as uncouth.

What I would love is a solution involving a lambda comparator that I can use in a std::set's template parameters. Is it possible?

Aucun commentaire:

Enregistrer un commentaire