r/cpp • u/User_Deprecated • Aug 26 '26
C++26: std::inplace_vector
https://www.sandordargo.com/blog/2026/08/26/cpp26-inplace-vector
178
Upvotes
r/cpp • u/User_Deprecated • Aug 26 '26
View all comments
Show parent comment
19
u/sephirothbahamut Aug 27 '26 edited Aug 27 '26
far more complex than that, the array has a slot that can fit T, not just T.
With array<T> every element must be validly constructed immediately. You can reduce it to array<T> only for trivially constructable and basic types