How fast is C++26’s std::hive?
cppdashboard.dev/r/2026/08/how-fast-is-cpp26-s-std-hiveDaniel Lemire is a software performance expert. He ranks among the top 2% of scientists globally (Stanford/Elsevier 2025) and is one of GitHub's top 1000 most followed developers. C++26 adds a new container to the standard library…
From the article
Daniel Lemire is a software performance expert. He ranks among the top 2% of scientists globally (Stanford/Elsevier 2025) and is one of GitHub's top 1000 most followed developers.
C++26 adds a new container to the standard library: std::hive . It is meant to occupy the ground between std::vector and std::list . Like a vector, it keeps its elements in contiguous blocks of memory, so scanning it does not require you to chase a pointer for every element. Like a list, it never moves an element once it has been inserted: your pointers, references and iterators stay valid, and you may erase any element in constant time without disturbing the others.
Internally, a hive is a linked list of blocks. Each block carries a skipfield : a small integer per slot that tells the iterator how many erased…
Share this resource