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
base: main
Are you sure you want to change the base?
Conversation
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`.
I think those
|
There was a problem hiding this 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}. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AlisdairM Ping?
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
.