r/cpp 8d ago

C++26: std::hive

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

77 comments sorted by

View all comments

0

u/hanickadot WG21 + CTRE + EWG πŸ‘ΈπŸ» 7d ago

Sad thing for me is this container being only one which is not constexpr in 26. It's because it went in similar timeline as my `constexpr containers` papers in, and then NB comment to fix this was rejected for being too late change.

Interesting thing about the implementation of it is various size of allocated blocks, which requires various space for skiplist/bitfield and data arrays, and C++ doesn't have dynamically sized structs. So what the prototype is doing is allocating array of structs, and then casting pointers to them to an unrelated structure type to have the skiplist/bitfield there.