3 ms·
Move is a template level concept, not a language concept. The compiler has no idea that something was moved, rather than assigned. Some implementations null out
by Animats 11y ago
Move is a template level concept, not a language concept. The compiler has no idea that something was moved, rather than assigned. Some implementations null out the "moved from" reference, so that a use after move will dereference null and crash the program.
I've referred to the attempts to fix C++ ownership semantics with templates as "wallpapering over the mold".