Date: Tue, 12 Nov 2024 13:03:01 +0100
On 12/11/2024 12.49, mauro russo wrote:
>> Not really:
>> template<int x>
>> struct A { };
>
> But... [temp.over.link]-5 reads
> "... and the tokens used to form concept-ids ([temp.names] <https://eel.is/c++draft/temp.names>) may differ as long as the two /template-id/ <https://eel.is/c++draft/temp.names#nt:template-id>/s/ are the same ([temp.type] <https://eel.is/c++draft/temp.type>). <https://eel.is/c++draft/temp.over.link#5.sentence-2>"
Please quote completely:
"Two unevaluated operands
that do not involve template parameters are considered equivalent if two function definitions containing the
expressions would satisfy the one-definition rule, except that the tokens used to name types and declarations
may differ as long as they name the same entities, and the tokens used to form concept-ids (13.3) may differ
as long as the two template-ids are the same (13.6).
[Note 3 : For instance, A<42> and A<40+2> name the same type. — end note]"
This is highlighting the "tokens used to name types may differ" part of the rule.
Obviously, concept-ids don't name types.
> I mean, well, [temp.type]-2 is clear about "same" template-ids, not requiring the same tokens.
> Why in [temp.over.link]-5 we need this example that has nothing more than the Example 1 in [temp.type]-3 for 'x' and 'y' ?
It's trying to explain the rule a little bit. We can certainly get rid of the note
if it's confusing.
> That's why I supposed that A<40> and A<42> were related to the statement on unevaluated operands,
> as example of same (simple-)template-ids representing the concept-ids ([temp.names]-9, currently §13.3-9).
> Should it be replaced with an example showing concept-ids with different tokens ?
If we don't need to highlight "same type", we shouldn't need to highlight the
concept-id situation, either. It's also covered by [temp.type].
Jens
>> Not really:
>> template<int x>
>> struct A { };
>
> But... [temp.over.link]-5 reads
> "... and the tokens used to form concept-ids ([temp.names] <https://eel.is/c++draft/temp.names>) may differ as long as the two /template-id/ <https://eel.is/c++draft/temp.names#nt:template-id>/s/ are the same ([temp.type] <https://eel.is/c++draft/temp.type>). <https://eel.is/c++draft/temp.over.link#5.sentence-2>"
Please quote completely:
"Two unevaluated operands
that do not involve template parameters are considered equivalent if two function definitions containing the
expressions would satisfy the one-definition rule, except that the tokens used to name types and declarations
may differ as long as they name the same entities, and the tokens used to form concept-ids (13.3) may differ
as long as the two template-ids are the same (13.6).
[Note 3 : For instance, A<42> and A<40+2> name the same type. — end note]"
This is highlighting the "tokens used to name types may differ" part of the rule.
Obviously, concept-ids don't name types.
> I mean, well, [temp.type]-2 is clear about "same" template-ids, not requiring the same tokens.
> Why in [temp.over.link]-5 we need this example that has nothing more than the Example 1 in [temp.type]-3 for 'x' and 'y' ?
It's trying to explain the rule a little bit. We can certainly get rid of the note
if it's confusing.
> That's why I supposed that A<40> and A<42> were related to the statement on unevaluated operands,
> as example of same (simple-)template-ids representing the concept-ids ([temp.names]-9, currently §13.3-9).
> Should it be replaced with an example showing concept-ids with different tokens ?
If we don't need to highlight "same type", we shouldn't need to highlight the
concept-id situation, either. It's also covered by [temp.type].
Jens
Received on 2024-11-12 12:03:05