logoalt Hacker News

jjmarryesterday at 7:26 PM1 replyview on HN

> The moved object could be left in an unusable state, depending on your implementation, after stealing its internal resources.

The "proper" semantics are that it leaves the object in a valid but unspecified state. So, invariants still hold, you can call functions on it, or assign to it.


Replies

masklinnyesterday at 8:05 PM

> you can call functions on it

Only functions with no preconditions, unless the type makes more guarantees as to the moved-from state.

show 1 reply