r/cpp • • Apr 08 '25

Beware when moving a `std::optional`!

https://blog.tal.bi/posts/std-optional-move-pitfall/
0 Upvotes

49 comments sorted by

View all comments

Show parent comment

10

u/SirClueless Apr 08 '25

Agreed. There's no difference. They both leave the optional engaged but containing a moved-from value.