Question Details

No question body available.

Tags

c++ c++26

Answers (1)

April 18, 2025 Score: 12 Rep: 47,249 Quality: Expert Completeness: 80%

Congratulations! You are talking about the paper with the most revisions in the history of C++, which is the 28th version.

It seems C++26 will introduce a new container called std::hive, but there is no documentation of it yet.

The paper has been integrated into the latest C++ working draft, but cppreference has not been updated yet.

You can just refer to [hive].

Can somebody explain what kind of data collection is this new container?

From the original paper:

Hive is a formalisation, extension and optimization of what is typically known as a 'bucket array' or 'object pool' container in game programming circles. [...]

The concept of a bucket array is: you have multiple memory blocks of elements, and a boolean token for each element which denotes whether or not that element is 'active' or 'erased' - commonly known as a skipfield. If it is 'erased', it is skipped over during iteration. When all elements in a block are erased, the block is removed, so that iteration does not lose performance by having to skip empty blocks. If an insertion occurs when all the blocks are full, a new memory block is allocated.