Does the C++ standard library have a set ordered by insertion order?

前端 未结 6 409
春和景丽
春和景丽 2021-01-11 09:30

Does the C++ standard library have an \"ordered set\" datastructure? By ordered set, I mean something that is exactly the same as the ordinary std::set but that

6条回答
  •  长情又很酷
    2021-01-11 10:22

    Instead of making a std::set of whatever type you're using, why not pass it a std::pair of the object and an index that gets incremented at each insertion?

提交回复
热议问题