r/cpp • • Sep 03 '26

C++26: std::hive

https://www.sandordargo.com/blog/2026/09/02/cpp26-hive
69 Upvotes

80 comments sorted by

View all comments

Show parent comment

3

u/jwakely libstdc++ tamer, LWG chair Sep 05 '26

One of the key properties is that hive can have holes between elements. When you erase an element, you are left with a hole and the elements before or after it are not shuffled along to fill the hole. This means that elements have stable addresses once inserted. And on the next insertion any hole can be used as the insertion point, instead of adding a new element at the end.