copy |
Defined in
<utility.hpp> |
Returns a copy of the argument
Returns a copy of the argument. Used to pass an lvalue to function taking an rvalue or to copy a type with an explicit
copy-constructor.
Parameters
Useful for functions that only take an rvalue reference or that have an explicit copy constructor.
Example:
void f(vector<int>&&);
//...
vector<int> a = ...;
f(copy(a)); // pass a copy
f(move(a)); // sink a