Skip to content

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.

@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.

@wg21bot wg21bot added the needs rebase The pull request needs a git rebase to resolve merge conflicts. label Jul 22, 2023
In the Cpp17Allocator requirements, all identifiers name specific
types, not type-dependent code in a template, even if they are
template instantiations.  Hence, all use of `::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.
@AlisdairM AlisdairM force-pushed the redundant_syntax_in_alloc_reqs branch from 1e15ae5 to 883e519 Compare October 23, 2024 14:16
@jensmaurer jensmaurer removed the needs rebase The pull request needs a git rebase to resolve merge conflicts. label Oct 23, 2024
@jensmaurer jensmaurer merged commit ced2c38 into cplusplus:main Oct 23, 2024
2 checks passed
@AlisdairM AlisdairM deleted the redundant_syntax_in_alloc_reqs branch November 19, 2024 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants