You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a function template specialization is referenced, all of the template arguments shall have values.
So, what are the necessary template arguments when referring to a function template specialization without using a template-id? It seems to we have no special rule that explicitly specify this point. For example:
template<classU, classT>
U fun(T){};
fun(0); // #1
According to [temp.deduct.call], the deduction is successful for T since the deduction only concerns the function parameter. The note [temp.deduct.call.note]/1 implies that the template-argument must be explicitly specified for U. Besides that, we have no formal rule to interpret why. Although [temp.deduct.general] p1 requires that all of the template arguments shall have values, however in this case, what are the necessary template arguments when referring to the specialization? I would expect that [temp.names] p7 can work here to interpret the aforementioned issue.
A template-id is valid if
[...]
there is an argument for each non-deducible non-pack parameter that does not have a default template-argument
Although the specialization referred to at #1 does not syntactically satisfy a template-id, however, it is as if the specialization were referred to by a template-id, merely, the template-argument-list is permitted to omit as per [temp.arg.explicit] p4.
For this issue, we just need a formal rule(like [temp.names] p7) to specify that we need two template arguments for parameters U and T in this case.
The text was updated successfully, but these errors were encountered:
[temp.deduct.general] p1 just states that:
So, what are the necessary template arguments when referring to a function template specialization without using a
template-id
? It seems to we have no special rule that explicitly specify this point. For example:According to [temp.deduct.call], the deduction is successful for
T
since the deduction only concerns the function parameter. The note [temp.deduct.call.note]/1 implies that the template-argument must be explicitly specified forU
. Besides that, we have no formal rule to interpret why. Although [temp.deduct.general] p1 requires that all of the template arguments shall have values, however in this case, what are the necessary template arguments when referring to the specialization? I would expect that [temp.names] p7 can work here to interpret the aforementioned issue.Although the specialization referred to at
#1
does not syntactically satisfy atemplate-id
, however, it is as if the specialization were referred to by atemplate-id
, merely, the template-argument-list is permitted to omit as per [temp.arg.explicit] p4.For this issue, we just need a formal rule(like [temp.names] p7) to specify that we need two template arguments for parameters
U
andT
in this case.The text was updated successfully, but these errors were encountered: