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
If a template parameter is used only in non-deduced contexts and is not explicitly specified, template argument deduction fails.
Consider this example:
template<class...T, classU>
voidfun(T...,U){
}
fun(0); // all major implementations accept it.
[temp.deduct.type] p5 states that the template parameter pack T is used in a non-deduced context:
The non-deduced contexts are:
[...]
A function parameter pack that does not occur at the end of the parameter-declaration-list.
The parameter is only used in a non-deduced context. [temp.arg.explicit.note]/1 also implies the example is ok. The following change may be an improvement:
If a template parameter that is not a template parameter pack is used only in non-deduced contexts and is not explicitly specified, template argument deduction fails.
Uh oh!
There was an error while loading. Please reload this page.
[temp.deduct.type] p4 states that:
Consider this example:
[temp.deduct.type] p5 states that the template parameter pack
T
is used in a non-deduced context:The parameter is only used in a non-deduced context. [temp.arg.explicit.note]/1 also implies the example is ok. The following change may be an improvement:
Relevant issue: #4555
The text was updated successfully, but these errors were encountered: