C++ Logo

STD-DISCUSSION

Advanced search

Subject: [temp.deduct] editorial changes
From: Will Hawkins (hawkinsw_at_[hidden])
Date: 2019-07-28 14:56:28


Hello C++ standards aficionados!

By way of introduction, as they say on call-in talk radio, I am a
long-time C++ developer (early 90s) but a first-time standards
contributor. I appreciate all the work that each one of you does to
keep C++ on the cutting edge of programming language design. I have
recently become very interested in the standardization process and I
am eager to get involved and to contribute.

As a first attempt to contribute, I humbly propose the wording changes
to [temp.deduct] specified in PR 3095
(https://github.com/cplusplus/draft/pull/3095). I have done my best to
understand the process of proposing editorial changes and follow those
rules. If I have made a mistake that causes wasted time, I apologize.

Here I will lay out my assumptions that underlie the proposed changes
and encourage you to correct me where I am (inevitably) wrong.

As I understand it, the first part of [temp.deduct] explains the
overall process of how "all of the template arguments [get] values"
"[w]hen a function template specialization is referenced." In other
words, the first part of [temp.deduct] describes the overall process
of how the language takes a function template reference that has 0 or
more explicit template arguments and uses those explicit values,
deduction or default template arguments to arrive at values for all of
the template arguments. Certain subsections of [temp.deduct] (and
other parts of the standard) describe specifically how to do
deduction, etc.

Paragraph 3 of [temp.deduct] seems to specify that the adjustments to
function parameters is done after the substitution of explicitly
specified template arguments for the corresponding template argument
parameters.

Paragraph 5 seems to specify that template argument deduction and the
use of template argument values from default template parameters is
used after substitution of explicit template arguments for template
parameters and adjustments. Deduction and the use of default argument
values (more or less) completes the process of generating template
argument values to satisfy the requirement that "all of the template
arguments [...] have values" at the time of reference.

Paragraph 6 seems to specify that template arguments values replace
the corresponding template parameters as the first and last step of
getting all the values for template parameters. Paragraph 7 seems to
specify how that replacement takes place and calls it substitution.

If that understanding is correct, in my reading, it seems like the
term "substitution" is used loosely and could cause confusion. It did
for me! The modest changes in PR 3095 attempt to make those uses a
little more clear.

I hope that these are useful contributions and I look forward to
hearing the feedback of people who are smarter and more experienced
than me. Thank you for taking the time to educate me on the process.

Thank you everyone!
Will


STD-DISCUSSION list run by herb.sutter at gmail.com

Older Archives on Google Groups