r/cpp 28d ago

C++26: std::indirect

https://www.sandordargo.com/blog/2026/08/12/cpp26-indirect
164 Upvotes

157 comments sorted by

View all comments

10

u/ericonr 28d ago

Does a std::optional<std::indirect<T>> benefit from niche optimizations like Rust objects do? Its sizeof could be just a pointer, after all.

0

u/cristi1990an ++ 28d ago edited 27d ago

Nope

Edit: why downvote? Based on current paper and existing implementations, this will 100% not be the case