tmp/tmpqn09om8l/{from.md → to.md}
RENAMED
|
@@ -1,43 +1,43 @@
|
|
| 1 |
### Qualification conversions <a id="conv.qual">[[conv.qual]]</a>
|
| 2 |
|
| 3 |
-
A *
|
| 4 |
-
`T` is
|
| 5 |
|
| 6 |
where each cvᵢ is a set of cv-qualifiers [[basic.type.qualifier]], and
|
| 7 |
each Pᵢ is “pointer to” [[dcl.ptr]], “pointer to member of class Cᵢ of
|
| 8 |
type” [[dcl.mptr]], “array of Nᵢ”, or “array of unknown bound of”
|
| 9 |
[[dcl.array]]. If Pᵢ designates an array, the cv-qualifiers cvᵢ₊₁ on the
|
| 10 |
element type are also taken as the cv-qualifiers cvᵢ of the array.
|
| 11 |
|
| 12 |
[*Example 1*: The type denoted by the *type-id* `const int **` has
|
| 13 |
-
three
|
| 14 |
-
`const int`”, and as “pointer to pointer to
|
| 15 |
`const int`”. — *end example*]
|
| 16 |
|
| 17 |
The n-tuple of cv-qualifiers after the first one in the longest
|
| 18 |
-
|
| 19 |
-
*cv-qualification signature* of `T`.
|
| 20 |
|
| 21 |
-
Two types `T1` and `T2` are *similar* if they have
|
| 22 |
-
with the same n such that corresponding Pᵢ
|
| 23 |
-
same or one is “array of Nᵢ” and the other is
|
| 24 |
-
of”, and the types denoted by `U` are the same.
|
| 25 |
|
| 26 |
-
The *
|
| 27 |
-
similar to `T1` whose
|
| 28 |
|
| 29 |
-
- for every i > 0, cv³ᵢ is the union of cv¹ᵢ and cv²ᵢ
|
| 30 |
- if either P¹ᵢ or P²ᵢ is “array of unknown bound of”, P³ᵢ is “array of
|
| 31 |
-
unknown bound of”, otherwise it is P¹ᵢ
|
| 32 |
- if the resulting cv³ᵢ is different from cv¹ᵢ or cv²ᵢ, or the resulting
|
| 33 |
P³ᵢ is different from P¹ᵢ or P²ᵢ, then `const` is added to every cv³ₖ
|
| 34 |
-
for 0 < k < i
|
| 35 |
|
| 36 |
-
where cvʲᵢ and Pʲᵢ are the components of the
|
| 37 |
-
prvalue of type `T1` can be converted to type `T2` if the
|
| 38 |
-
type of `T1` and `T2` is `T2`.
|
| 39 |
|
| 40 |
[*Note 1*:
|
| 41 |
|
| 42 |
If a program could assign a pointer of type `T**` to a pointer of type
|
| 43 |
`const` `T**` (that is, if line \#1 below were allowed), a program could
|
|
@@ -55,12 +55,12 @@ int main() {
|
|
| 55 |
```
|
| 56 |
|
| 57 |
— *end note*]
|
| 58 |
|
| 59 |
[*Note 2*: Given similar types `T1` and `T2`, this construction ensures
|
| 60 |
-
that both can be converted to the
|
| 61 |
-
`T2`. — *end note*]
|
| 62 |
|
| 63 |
[*Note 3*: A prvalue of type “pointer to *cv1* `T`” can be converted to
|
| 64 |
a prvalue of type “pointer to *cv2* `T`” if “*cv2* `T`” is more
|
| 65 |
cv-qualified than “*cv1* `T`”. A prvalue of type “pointer to member of
|
| 66 |
`X` of type *cv1* `T`” can be converted to a prvalue of type “pointer to
|
|
|
|
| 1 |
### Qualification conversions <a id="conv.qual">[[conv.qual]]</a>
|
| 2 |
|
| 3 |
+
A *qualification-decomposition* of a type `T` is a sequence of cvᵢ and
|
| 4 |
+
Pᵢ such that `T` is
|
| 5 |
|
| 6 |
where each cvᵢ is a set of cv-qualifiers [[basic.type.qualifier]], and
|
| 7 |
each Pᵢ is “pointer to” [[dcl.ptr]], “pointer to member of class Cᵢ of
|
| 8 |
type” [[dcl.mptr]], “array of Nᵢ”, or “array of unknown bound of”
|
| 9 |
[[dcl.array]]. If Pᵢ designates an array, the cv-qualifiers cvᵢ₊₁ on the
|
| 10 |
element type are also taken as the cv-qualifiers cvᵢ of the array.
|
| 11 |
|
| 12 |
[*Example 1*: The type denoted by the *type-id* `const int **` has
|
| 13 |
+
three qualification-decompositions, taking `U` as “`int`”, as “pointer
|
| 14 |
+
to `const int`”, and as “pointer to pointer to
|
| 15 |
`const int`”. — *end example*]
|
| 16 |
|
| 17 |
The n-tuple of cv-qualifiers after the first one in the longest
|
| 18 |
+
qualification-decomposition of `T`, that is, cv₁, cv₂, …, cvₙ, is called
|
| 19 |
+
the *cv-qualification signature* of `T`.
|
| 20 |
|
| 21 |
+
Two types `T1` and `T2` are *similar* if they have
|
| 22 |
+
qualification-decompositions with the same n such that corresponding Pᵢ
|
| 23 |
+
components are either the same or one is “array of Nᵢ” and the other is
|
| 24 |
+
“array of unknown bound of”, and the types denoted by `U` are the same.
|
| 25 |
|
| 26 |
+
The *qualification-combined type* of two types `T1` and `T2` is the type
|
| 27 |
+
`T3` similar to `T1` whose qualification-decomposition is such that:
|
| 28 |
|
| 29 |
+
- for every i > 0, cv³ᵢ is the union of cv¹ᵢ and cv²ᵢ,
|
| 30 |
- if either P¹ᵢ or P²ᵢ is “array of unknown bound of”, P³ᵢ is “array of
|
| 31 |
+
unknown bound of”, otherwise it is P¹ᵢ, and
|
| 32 |
- if the resulting cv³ᵢ is different from cv¹ᵢ or cv²ᵢ, or the resulting
|
| 33 |
P³ᵢ is different from P¹ᵢ or P²ᵢ, then `const` is added to every cv³ₖ
|
| 34 |
+
for 0 < k < i,
|
| 35 |
|
| 36 |
+
where cvʲᵢ and Pʲᵢ are the components of the qualification-decomposition
|
| 37 |
+
of `T`j. A prvalue of type `T1` can be converted to type `T2` if the
|
| 38 |
+
qualification-combined type of `T1` and `T2` is `T2`.
|
| 39 |
|
| 40 |
[*Note 1*:
|
| 41 |
|
| 42 |
If a program could assign a pointer of type `T**` to a pointer of type
|
| 43 |
`const` `T**` (that is, if line \#1 below were allowed), a program could
|
|
|
|
| 55 |
```
|
| 56 |
|
| 57 |
— *end note*]
|
| 58 |
|
| 59 |
[*Note 2*: Given similar types `T1` and `T2`, this construction ensures
|
| 60 |
+
that both can be converted to the qualification-combined type of `T1`
|
| 61 |
+
and `T2`. — *end note*]
|
| 62 |
|
| 63 |
[*Note 3*: A prvalue of type “pointer to *cv1* `T`” can be converted to
|
| 64 |
a prvalue of type “pointer to *cv2* `T`” if “*cv2* `T`” is more
|
| 65 |
cv-qualified than “*cv1* `T`”. A prvalue of type “pointer to member of
|
| 66 |
`X` of type *cv1* `T`” can be converted to a prvalue of type “pointer to
|