3 ms·
every argument is passed by move, not just almost every. Types that implement Copy are still moved. Copy just means “the original value is still usable after m
by School-Cotton 4y ago
every argument is passed by move, not just almost every.
Types that implement Copy are still moved. Copy just means “the original value is still usable after move”.
- cmrdporcupine 4y agofair enough, but also the semantics of a Rust 'move' aren't identical to C++ std::move anyways. you can "get it back" after the function call, as it's a borrow, not a move. Makes me wonder out loud if the C++ community isn't going to add some kind of std::borrow/std::return_borrowed to the language. If that's even feasible with the type system and reference system as it is today.