3 ms·
> and destructors for moved-from objects not called This doesn't work entirely cleanly in cases the compiler can't track liveness, which is more of an issue fo
by Veedrac 6y ago
> and destructors for moved-from objects not called
This doesn't work entirely cleanly in cases the compiler can't track liveness, which is more of an issue for C++ than Rust, since you want to be able to move out of pointers. A simple solution is to replace move operators with an `invalidate` function the compiler calls after doing a shallow move, that sets the old value to a moved-from state.
Copy constructors (as opposed to copy assignment operators) are already a fine way to copy a value, there's no real need to change that.
- deleted 6y ago[deleted]