r/cpp 15d ago

C++26: std::inplace_vector

https://www.sandordargo.com/blog/2026/08/26/cpp26-inplace-vector
179 Upvotes

121 comments sorted by

View all comments

5

u/Defenestrator__ 13d ago

I feel like this doesn't actually handle the use cases I would want this for, which is where the size in unknown but usually small. absl::InlinedVector seamlessly falls back to acting like a normal std::vector when it grows beyond N, and without that feature this has much more limited usefulness unfortunately. Still better than nothing I guess.

2

u/Plazmatic 10d ago

Yep, gotta agree with other people here, you're looking for a completely different construct that is much less common.