4 ms·
> which may be read after being moved-from (a valid behaviour in some systems code contexts) std::move as applied to standard library types will leave the obje
by jjmarr 1y ago
> which may be read after being moved-from (a valid behaviour in some systems code contexts)
std::move as applied to standard library types will leave the object in a "valid but unspecified state".[1] If you're leaving the object in an invalid state (one where the invariants are broken), you're not writing idiomatic C++.
[1] https://en.cppreference.com/w/cpp/utility/move.html https://en.cppreference.com/w/cpp/utility/move.html
- jandrewrogers 1y agoI am using “invalid” here in the semantic sense of not containing a meaningful value. It is not invalid in a structural sense.