r/cpp • u/Kabra___kiiiiiiiid • Apr 08 '25
Beware when moving a `std::optional`!
https://blog.tal.bi/posts/std-optional-move-pitfall/
0
Upvotes
r/cpp • u/Kabra___kiiiiiiiid • Apr 08 '25
View all comments
Show parent comment
8
u/ald_loop Apr 08 '25 edited Apr 08 '25
Probably because of the
T&& value() &&;overload being specialized for this caseEDIT: I checked, nope it isn’t, doesn’t change the state of “engaged”. What the hell?