|
|
|
|
|
by ismailmaj
900 days ago
|
|
The function could accept an universal reference instead of an rvalue reference, this avoids the dance the caller has to do to pass a copy. IMO it's hard to beat pass by value considering both performance and cognitive load. |
|
...but that requires the argument to be a type from a template D: so you'd have to write:
...and that's not quite right either, since you'd want it to be either an rvalue reference or a const lvalue reference