A forwarding reference refers to a reference type that may either be an lvalue reference or an rvalue reference depending on its initializer. They allow the user to employ perfect-forwarding. The term applies either to a parameter of type T&& where T is a template parameter type or auto, as well as to auto&& local variables.
The term forwarding-reference is intended to replace deprecated name universal-reference.
The term applies to a parameter of type T&&
where T
is a template parameter type:
template <class T>
void f(T&& t) {}
or where T
is auto
:
[] (auto&& a) {}
as well as refers to auto&&
local variables:
for (auto&& e : c) {}
The related wording proposal is http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4164.pdf