top | item 42326771

(no title)

eterevsky | 1 year 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.

discuss

order

masklinn|1 year ago

std::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.