2 ms·
> As far as I'm aware moves are only done when explicitly asked for Certainly not. Move are attempted (in the sense that the move constructor/operator= will be
by wilun 9y ago
> As far as I'm aware moves are only done when explicitly asked for
Certainly not. Move are attempted (in the sense that the move constructor/operator= will be called if it exists) from rvalue references. Those are for example all temporaries. That has let accelerate all C++ programs using std objects by simply recompiling them (with the new versions of the objects supporting the move while it did not exist in the old versions)
- saagarjha 9y agoWell, it makes sense to move temporaries. There's no point in copying them again if the original won't be used.