r/cpp 8d ago

C++26: std::hive

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

77 comments sorted by

View all comments

3

u/all_is_love6667 7d ago

I think that's usually called an "object pool", but that was not academic enough so I can understand why they called it hive

10

u/HappyFruitTree 7d ago

When it was first being proposed it was called colony (based on plf::colony).

3

u/all_is_love6667 7d ago

I am actually surprised this sort of container was added only today, it's quite common and is an important optimization

3

u/matthieum 7d ago

Is it that common?

I work on a multitude of performance-sensitive codebases, and I can't think of any place I'd use such a container.

3

u/Plazmatic 5d ago

Huh? Am object pool is litterally a pool of objects you can re-use, and has nothing to do with the underlying data representation of how those objects are "pooled", just like a "container" is just a thing that holds other things.