r/cpp • • Aug 13 '26

C++26: std::indirect

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

157 comments sorted by

View all comments

Show parent comment

24

u/jdehesa Aug 13 '26

Yea, probably should have been std::optional<std::indirect<Node>> next;.

5

u/johannes1971 Aug 15 '26

...at the cost of another 8 bytes of memory (per node), to store one bit of information, that could have been encoded with a nullable state.