Is there already some std::vector based set/map implementation?

前端 未结 6 1518
囚心锁ツ
囚心锁ツ 2021-02-08 07:43

For small sets or maps, it\'s usually much faster to just use a sorted vector, instead of the tree-based set/map - especially for something like 5-10 e

6条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-08 08:43

    Old post, I know, but for more recent visitors, Boost's flat_set and flat_map look like what you need. See https://theboostcpplibraries.com/boost.container for more information.

提交回复
热议问题