Skip to content
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

Rename non-type template parameter/argument to "constant" #7587

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

cor3ntin
Copy link
Contributor

As previously discussed by CWG.
The aim is to editorially adopt some of the wording changes made in P2841R5 to ease its review in core.

Note that not all-instance of non-type have been
mechanically replaced as [dcl] and [diff] use
the term to refer to anything that is not a type
in the context of lookup

As previously discussed by CWG.
The aim is to editorially adopt some of the wording
changes made in P2841R5 to ease its review in core.

Note that not all-instance of non-type have been
mechanically replaced as [dcl] and [diff] use
the term to refer to anything that is not a type
in the context of lookup
@tkoeppe tkoeppe added the cwg Issue must be reviewed by CWG. label Jan 26, 2025
source/templates.tex Outdated Show resolved Hide resolved
source/templates.tex Outdated Show resolved Hide resolved
source/templates.tex Outdated Show resolved Hide resolved
@@ -296,9 +296,9 @@
and template
\grammarterm{template-argument}{s}
are treated as types for descriptive purposes, the terms
\term{non-type parameter}
\term{constant template parameter}
Copy link
Contributor

@hubert-reinterpretcast hubert-reinterpretcast Feb 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The footnote makes no sense following the change being proposed here. I really think we should just strike the first part of the sentence @jensmaurer @cor3ntin.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hubert-reinterpretcast It gets struck by the paper (which updates the surrounded text), hopefully we can live with that imperfection for a few weeks. I don't have any objection to do it now but we agreed to keep the changes minimal

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hopefully we can live with that imperfection for a few weeks

I would rather not risk needing the paper to keep things in shape.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not clear that the concept template parameters paper makes it to the Hagenberg plenary, given that we also have contracts and reflection on the plate, which take priority. Given Hubert's view, I think I want the bulleted list from the paper (which replaces the footnote) here, because we otherwise have no definition for the term "constant template parameter", it seems.

That's still editorial, I think; we don't change the meaning of the specification.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bulleted list refers to grammar production that don't exist in the current wording

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather go with Hubert suggestion and remove the first part of the sentence. The fact that we have a definition in a footnote was pre-existing. I'll do that

All other non-type arguments are specialized.
A constant template argument is non-specialized if it is the name of a constant
template parameter.
All other constant arguments are specialized.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
All other constant arguments are specialized.
All other constant template arguments are specialized.

@@ -4598,7 +4598,7 @@
\item \grammarterm{parameter-declaration} in a \grammarterm{lambda-declarator}
or \grammarterm{requirement-parameter-list},
unless that \grammarterm{parameter-declaration} appears in a default argument, or
\item \grammarterm{parameter-declaration} of a (non-type) \grammarterm{template-parameter}.
\item \grammarterm{parameter-declaration} of a (constant) \grammarterm{template-parameter}.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
\item \grammarterm{parameter-declaration} of a (constant) \grammarterm{template-parameter}.
\item \grammarterm{parameter-declaration} of a \grammarterm{template-parameter} that declares a constant template parameter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered that (and also to remove the parenthetical entirely). parameter-declaration implies a constant template parameter, I'm afraid your wording might imply the existence of some alternative

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
\item \grammarterm{parameter-declaration} of a (constant) \grammarterm{template-parameter}.
\item \grammarterm{parameter-declaration} of a \grammarterm{template-parameter} (which necessarily declares a constant template parameter).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cor3ntin, I think you applied the older suggestion? Jens expressed a preference for the newer one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed (I completely missed it)

source/templates.tex Outdated Show resolved Hide resolved
source/templates.tex Outdated Show resolved Hide resolved
source/templates.tex Outdated Show resolved Hide resolved
@cor3ntin
Copy link
Contributor Author

cor3ntin commented Feb 4, 2025

@jensmaurer Can we make progress on this this week? I am afraid things are going to be rather messy otherwise. Thanks

Copy link
Contributor

@hubert-reinterpretcast hubert-reinterpretcast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM; thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cwg Issue must be reviewed by CWG.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants