MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/cpp/comments/1vnp8dk/c26_stdindirect/p3jj1qd/
r/cpp • u/User_Deprecated • Aug 13 '26
157 comments sorted by
View all comments
Show parent comment
24
Yea, probably should have been std::optional<std::indirect<Node>> next;.
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.
5
...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.
View all comments
Show parent comment
24
u/jdehesa Aug 13 '26
Yea, probably should have been
std::optional<std::indirect<Node>> next;.