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

[temp.constr.normal] The obscure(contradictory) of the normalization of a concept-id #5389

Open
xmh0511 opened this issue Apr 8, 2022 · 0 comments

Comments

@xmh0511
Copy link
Contributor

xmh0511 commented Apr 8, 2022

[temp.constr.normal] p1.4 says

The normal form of a concept-id C<A1, A2,..., An> is the normal form of the constraint-expression of C, after substituting A1, A2,..., An for C's respective template parameters in the parameter mappings in each atomic constraint. If any such substitution results in an invalid type or expression, the program is ill-formed; no diagnostic is required.

This sounds like a paradox. "after" means the substitution occurs before the normal form of the constraint-expression of C, whereas the substitution requires us to determine the template parameters in the parameter mappings in each atomic constraint, which means we should firstly determine what atomic constraints are in the normal form of the concept-id. I think [temp.constr.normal] p1.4 might be changed to

The normal form of a concept-id C<A1, A2,..., An> is the normal form of the constraint-expression of C by substituting A1, A2,..., An for C's respective template parameters in the parameter mappings in each atomic constraint. If any such substitution results in an invalid type or expression, the program is ill-formed; no diagnostic is required.

I think the logic of normalizing an expression is that makes each operand in a logical operation is an atomic constraint. So, for any expression E, normalization of E is reasonable to recursively apply [temp.constr.normal] p1 to E so that obtains the atomic constraints, only after which can substitute the template arguments for the template parameter in the parameter mappings apply, as per the definition of parameter mapping.

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

No branches or pull requests

1 participant