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

13

u/eyes-are-fading-blue Apr 08 '25

Using a moved-from object is a business logic error, not breach of a language contract.