2 ms·
How does adding an operator help? There are two main advantage of having move semantics in the language and at least one of them relies on the fact that moves a
by kevinnk 10y ago
How does adding an operator help? There are two main advantage of having move semantics in the language and at least one of them relies on the fact that moves are implicit; you can write code that will move objects if supported and copy/destroy if not (for example, when returning an object or using an intermediate value in an expression). Adding an operator erases that advantage.
The other advantage is that you can force only move semantics which allows enforcing things like ownership. Adding an operator doesn't destroy this advantage, but it is a bit silly since you're just adding line noise for something that really should be implicit anyway.
Unless you just literally don't like the spelling of "std::move" which seems pretty lame since it should be relatively rare anyway.