After reading this thread auto&&
, does it mean that we should always use auto&&
instead of auto
when we declare a local variable to capture the return type of a function (to exactly preserve the type returned by the function) ?
Use cases could be for instance
auto&& result = func_returning_lvalue_or_lvalue_reference();
or
auto&& iterator = vector_.begin();
or anything else.
In other terms it is normal to have a base code with a lot of auto&&
?