Consider the following snippet below:
template
using identity = T;
template
void foo(identity&&) {}
int ma
It is not a forwarding reference. C++14 (n4140) 14.8.2.1/3 (emphasis mine):
... If
P
is an rvalue reference to a cv-unqualified template parameter and the argument is an lvalue, the type “lvalue reference toA
” is used in place ofA
for type deduction.
This is the piece of the standard which specifies how forwarding references work. P
, the type of the function parameter, is of type "rvalue reference to identity
." identity
is the type of the template parameter, but it is not a template parameter itself, so the forwarding reference deduction rule does not apply.
We can also look at what 14.5.7/2 has to say about alias templates:
When a template-id refers to the specialization of an alias template, it is equivalent to the associated type obtained by substitution of its template-arguments for the template-parameters in the type-id of the alias template.
So the substituted alias is equivalent to the type of T
, but 14.8.2.1/3 reads "reference to ... template parameter," not "reference to ... the type of a template parameter."