3 ms·
Compiler will not warn this: MovableObject a, b, c; b = std::move(a); c = std::move(a); `c` may contain garbage. BTW the "move trait" (as its cal
by sebastic 11y ago
Compiler will not warn this:
MovableObject a, b, c;
b = std::move(a);
c = std::move(a);
`c` may contain garbage.
BTW the "move trait" (as its called in rust) is a related but orthogonal concept to its borrow checker.
- catnaroek 11y agoIn Rust, moving isn't a trait. It's the default, non-overridable behavior of assignment and argument passing. And everything is movable.