After reading this thread auto&&, does this mean that we should always use auto&&instead auto, when we declare a local variable to capture, the return type of the function (in order to accurately preserve the type returned by the function)?
Examples of use may be, for example,
auto&& result = func_returning_lvalue_or_lvalue_reference();
or
auto&& iterator = vector_.begin();
or something else.
In other terms, usually has a base code with a lot of auto&&?
source
share