r/cpp • u/User_Deprecated • Aug 26 '26
C++26: std::inplace_vector
https://www.sandordargo.com/blog/2026/08/26/cpp26-inplace-vector
181
Upvotes
r/cpp • u/User_Deprecated • Aug 26 '26
View all comments
Show parent comment
2
u/ABlockInTheChain Aug 27 '26
Consider
std::span.This is a class that should have been invented immediately once C++ got templates. We finally got it in C++20, only about 30 years late.
...but then the initial version didn't include
at()for some dumb reasons or another and it took two complete standard cycles to fix this....but even then we only got a version of
at()that throws at runtime and not a templatedat<n>()with compile time bounds checking likefirst<n>(),last<n>(), andsubspan<x, y>().