Is there a sorted_vector class, which supports insert() etc.?

后端 未结 6 870
情话喂你
情话喂你 2020-12-24 04:34

Often, it is more efficient to use a sorted std::vector instead of a std::set. Does anyone know a library class sorted_vector, which b

6条回答
  •  情歌与酒
    2020-12-24 05:25

    Here is my sorted_vector class that I've been using in production code for years. It has overloads to let you use a custom predicate. I've used it for containers of pointers, which can be a really nice solution in a lot of use cases.

提交回复
热议问题