Article

How fast is C++26’s std::hive?

raymii ·Lobsters ·Published 2026-08-02

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…

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


Discovered 2026-08-03 Source Lobsters Archive 2026-08 →