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

[allocator.requirements.general] Remove redundant template syntax #5872

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AlisdairM
Copy link
Contributor

In the Cpp17Allocator requirements, all identifiers name specific types, even if they are template instantiations. Hence, all use of typename, .template, and ::template is redundant. Not in the sense of we are awaiting LWG to review P2150 for policy, but in the sense these have been redundant since C++11, and were outright ill-formed prior to that.

The majority of the wording throughout this subclause already (correctly) avoids use of these redundant keywords. This PR brings the title rows into agreement with the body text, and fixes one outstanding redundant use of ::template.

In the Cpp17Allocator requirements, all identifiers name specific
types, even if they are template instantiations.  Hence, all use
of `typename`, `.template`, and `::template` is redundant.  Not
in the sense of we are awaiting LWG to review P2150 for policy,
but in the sense these have been redundant since C++11, and were
outright ill-formed prior to that.

The majority of the wording throughout this subclause already
(correctly) avoids use of these redundant keywords.  This PR
brings the title rows into agreement with the body text, and
fixes one outstanding redundant use of `::template`.
@JohelEGP
Copy link
Contributor

I think those typename are blessed now:

(3.7)
Result: for a typename-specifier, a description of the named type; for an expression, a description of the type of the expression; the expression is an lvalue if the type is an lvalue reference type, an xvalue if the type is an rvalue reference type, and a prvalue otherwise.

Copy link
Member

@jwakely jwakely left a comment

Choose a reason for hiding this comment

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

These aren't code, they're descriptions of members. As such, I think it's useful to show that these are types. It's how you'd write it in a requires-expression too:

requires { typename X::pointer; }

I don't think this change would be an improvement.

@@ -2133,7 +2133,7 @@
\pnum
\ensures
For all \tcode{U} (including \tcode{T}),
\tcode{Y::template rebind<T>::other} is \tcode{X}.
\tcode{Y::rebind<T>::other} is \tcode{X}.
Copy link
Member

Choose a reason for hiding this comment

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

This one seems correct though.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jwakely Are there any other cases of ::template that could be removed from the draft?

Copy link
Member

Choose a reason for hiding this comment

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

The Note 2 on [container.reqmts] p64 is unclear, but as a note I don't think it matters either way. I can't find any others.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, thanks! @AlisdairM, could you retool this PR please to only contain this one change, and revert all the others?

Copy link
Contributor

Choose a reason for hiding this comment

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

@AlisdairM Ping?

@wg21bot wg21bot added the needs rebase The pull request needs a git rebase to resolve merge conflicts. label Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs rebase The pull request needs a git rebase to resolve merge conflicts.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants