New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[temp.deduct.type] p4 values vs parameters #4884
Comments
[temp.deduct.type] p3 uses the same phrasing "A given type P can be composed from a number of other types, templates, and non-type values:" Note that p3 does a recursive decomposition here, and looks through nested types etc, not all of which are (directly) template parameters. So, this part looks sane. I agree with the concerns about "In certain contexts, however, the value does not participate in type deduction, " |
For the first concern, my opinion is, given P Maybe it will be more clear
Incidentally, [temp.deduct.type] p3 just specify what things can form the P, however, it didn't mention template argument deduction, I just think we should restrict which P actually needs to participate in template argument deduction. The following sentence has proved that
Whatever how degree are these template parameters nested, the template arguments always correspond to these template parameters, that is, template parameters are ultimately participated in deduction to deduce the corresponding template arguments for them. |
"For the first concern": I think this describes the contexts in which deduction is possible, in a general fashion. I don't think it's strictly necessary to talk about template parameters for that description to work. I'm not sure we consistently say "value of a template parameter" vs. "value of a template argument". The first is my preference. |
[temp.deduct.call] p1 restricts that which P can participate in template argument deduction.
Also notes the note following [temp.deduct.type] p4
So, in [temp.deduct.type] p4, we should specify which template parameters participate in template argument deduction and which do not. For "value of a template parameter" vs. "value of a template argument", why not we directly say
After all, the subject is "template argument deduction", hence the result of the deduction produces the corresponding template argument for the template parameter. |
Ah, a special case for [temp.deduct.type] is the partial ordering. Consider the example mentioned by CWG2235 template <class T> T f(int); // #1
template <class T, class U> T f(U); // #2 During the partial ordering, when
it should be covered in the second concern. |
Isn't that it should be phrased as the following
This keeps consistent with [temp.deduct.type] p1
The same issue is in the below sentence
It is the template parameter that participates in template argument deduction rather than the value. Furthermore, should we specifically say which case does not the template parameter participate in template argument deduction? At least, we should say the template parameter within a non-deduced context does not participate in the template argument deduction, which can associate it with the latter sentence "If a template parameter is used only in non-deduced contexts...".
The text was updated successfully, but these errors were encountered: