Change the code to follow two good C++11 idioms consistently:
Make unary constructors explicit.
When a copy of a parameter is needed, pass it by value and use std::move() as appropriate.
In the second case, using T&& instead of T means the function can't be called with an lvalue. Typically there is no meaningful difference in performance between the two.
Change the code to follow two good C++11 idioms consistently:
std::move()
as appropriate.In the second case, using
T&&
instead ofT
means the function can't be called with an lvalue. Typically there is no meaningful difference in performance between the two.