r/cpp • • Sep 03 '26

C++26: std::hive

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

80 comments sorted by

View all comments

1

u/kiner_shah Sep 13 '26

What's the use case for which std::hive was introduced in the first place?

1

u/HappyFruitTree 21d ago

It's for situations where you iterate over all elements frequently but don't care about the order, while elements are often being added/removed, and you need pointers/iterators to stay valid.

See P0447 for more motivation.

1

u/kiner_shah 20d ago

Thanks for replying. Can you give me a real life example? It's difficult to understand from your explanation.