1

C2x (N2596), 6.2.7 Compatible type and composite type, 1:

Two types have compatible type if their types are the same.

The grammar of that sentence is confusing.

For example:

  • How type can have a type? Or what does "their types" mean?
  • What does it mean "compatible type"? Any examples?

Please clarify who knows the topic well.

UPD. Here is the rephrased sentence:

Two types are compatible if they are the same.

Lundin
  • 195,001
  • 40
  • 254
  • 396
pmor
  • 5,392
  • 4
  • 17
  • 36
  • Does the answer here help? https://stackoverflow.com/questions/62622025/what-does-it-mean-exactly-if-two-types-are-compatible-to-each-other-in-c – EdmCoff Jan 11 '22 at 21:43
  • 2
    You're right that the grammar of that sentence is horrible. It should be "A type is *compatible* with itself." To answer your question of what "compatible type" means, you should look at all the other rules in the definition, because being the same type is *sufficient* but not *necessary*. – Ben Voigt Jan 11 '22 at 21:43
  • @EdmCoff Yes, it does, thanks. – pmor Jan 13 '22 at 17:35

1 Answers1

2

The sentence means if the type X and the type Y are the same type, then X is compatible with Y (and vice-versa, of course).

In mathematical terms, it means compatibility is reflexive (any type is compatible with itself).

Eric Postpischil
  • 195,579
  • 13
  • 168
  • 312