r/cpp • • Aug 26 '26

C++26: std::inplace_vector

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

121 comments sorted by

View all comments

Show parent comment

6

u/Ameisen vemips, avr, rendering, systems Aug 27 '26

Meanwhile, compilers are able to optimize out the check in exactly all the cases that are also easy to verify for humans.

Except that many compilers are awful at that... probably due to assuming potential side effects or aliasing changing the size when a human knows that that won't happen.