Choosing a STL container with uniqueness and which keeps insertion ordering

后端 未结 8 2061

I am unable to decide which STL container to use in the following case:

  1. I want to preserve the order of insertion of the elements
  2. The elements in the
8条回答
  •  庸人自扰
    2021-01-18 01:02

    Boost MultiIndex should be able to do exactly what you want - you can just use one sequenced index to get the "ordered by insertion order" requirement, and either a hashed_unique or ordered_unique index to get the uniqueness requirement.

提交回复
热议问题