Efficient linked list in C++?

后端 未结 11 627
孤街浪徒
孤街浪徒 2021-02-02 06:36

This document says std::list is inefficient:

std::list is an extremely inefficient class that is rarely useful. It performs a heap allocation

11条回答
  •  独厮守ぢ
    2021-02-02 07:07

    The new slot_map proposal claim O(1) for insert and delete.

    There is also a link to a video with a proposed implementation and some previous work.

    If we knew more about the actual structure of the elements there might be some specialized associative containers that are much better.

提交回复
热议问题