4 ms·
In C++ you can force the move of the parameter by wrapping it with std::move() this should take care of unnecessarily cloning the argument in the example.
by eterevsky 2y ago
In C++ you can force the move of the parameter by wrapping it with std::move() this should take care of unnecessarily cloning the argument in the example.
- masklinn 2y agostd::move does not force anything , it is a cast to an rvalue reference (a movable-from). Whether the object is moved depends on whether the target / destination / sink cares.
- deleted 2y ago[deleted]