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
47
u/stilgarpl Aug 27 '26
Optional is monadic, so it's much safer to deal with. You can call it like
inplace_vector.try_push_back(x).or_else(...);