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

[expr.prim.req.type] Clarify example comment re: validity of name only #4457

Conversation

hubert-reinterpretcast
Copy link
Contributor

The comment that a class template specialization is required can be taken as meaning that more is required than the validity of the template-id (which is all that the requirement really checks).

source/expressions.tex Outdated Show resolved Hide resolved
Comment on lines 2740 to 2741
typename S<T>; // required valid~(\ref{temp.names}) \grammarterm{template-id};
// fails if substitution failure occurs for the second template parameter of \tcode{S}
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the cross-reference.
"substitution failure" feels too unspecific here, because it could mean substitution failure while instantiating all of S<T, X> ("substitution for" is not really "substitution into"). What we mean is substitution failure into the template-head. Suggestion, a little more tailored to the example:
"fails if \tocde{T} has no nested type \tcode{type}"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"substitution failure" feels too unspecific here, because it could mean substitution failure while instantiating all of S<T, X> ("substitution for" is not really "substitution into").

Okay, I can change it to say "substitution into".

What we mean is substitution failure into the template-head. Suggestion, a little more tailored to the example:
"fails if \tocde{T} has no nested type \tcode{type}"

Well, it also fails if 0 cannot be implicitly converted to T::type.

@jensmaurer
Copy link
Member

(needs squashing)

The comment that a class template specialization is required can be
taken as meaning that more is required than the validity of the
template-id (which is all that the requirement really checks).

Additionally, the specific implications of the validity requirement is
spelled out.
@hubert-reinterpretcast hubert-reinterpretcast force-pushed the better_concept_type_req_example_comment branch from 81152b2 to bb1fbd8 Compare January 9, 2021 14:46
@tkoeppe tkoeppe merged commit a8e2d0d into cplusplus:master Jan 14, 2021
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.

None yet

3 participants