tmp/tmpawbsdp4f/{from.md → to.md}
RENAMED
|
@@ -1,29 +1,28 @@
|
|
| 1 |
-
## Pointer
|
| 2 |
|
| 3 |
-
A null pointer constant
|
| 4 |
-
member type; the result is the *null member pointer value* of
|
| 5 |
-
and is distinguishable from any pointer to member not created
|
| 6 |
-
null pointer constant. Such a conversion is called a *null member
|
| 7 |
pointer conversion*. Two null member pointer values of the same type
|
| 8 |
shall compare equal. The conversion of a null pointer constant to a
|
| 9 |
pointer to member of cv-qualified type is a single conversion, and not
|
| 10 |
-
the sequence of a pointer
|
| 11 |
-
qualification conversion
|
| 12 |
|
| 13 |
-
A prvalue of type “pointer to member of `B` of type
|
| 14 |
is a class type, can be converted to a prvalue of type “pointer to
|
| 15 |
-
member of `D` of type
|
| 16 |
-
[[class.derived]]
|
| 17 |
-
[[class.
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
member
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
destination type.[^5]
|
| 29 |
|
|
|
|
| 1 |
+
### Pointer-to-member conversions <a id="conv.mem">[[conv.mem]]</a>
|
| 2 |
|
| 3 |
+
A null pointer constant [[conv.ptr]] can be converted to a
|
| 4 |
+
pointer-to-member type; the result is the *null member pointer value* of
|
| 5 |
+
that type and is distinguishable from any pointer to member not created
|
| 6 |
+
from a null pointer constant. Such a conversion is called a *null member
|
| 7 |
pointer conversion*. Two null member pointer values of the same type
|
| 8 |
shall compare equal. The conversion of a null pointer constant to a
|
| 9 |
pointer to member of cv-qualified type is a single conversion, and not
|
| 10 |
+
the sequence of a pointer-to-member conversion followed by a
|
| 11 |
+
qualification conversion [[conv.qual]].
|
| 12 |
|
| 13 |
+
A prvalue of type “pointer to member of `B` of type cv `T`”, where `B`
|
| 14 |
is a class type, can be converted to a prvalue of type “pointer to
|
| 15 |
+
member of `D` of type cv `T`”, where `D` is a complete class derived
|
| 16 |
+
[[class.derived]] from `B`. If `B` is an inaccessible [[class.access]],
|
| 17 |
+
ambiguous [[class.member.lookup]], or virtual [[class.mi]] base class of
|
| 18 |
+
`D`, or a base class of a virtual base class of `D`, a program that
|
| 19 |
+
necessitates this conversion is ill-formed. The result of the conversion
|
| 20 |
+
refers to the same member as the pointer to member before the conversion
|
| 21 |
+
took place, but it refers to the base class member as if it were a
|
| 22 |
+
member of the derived class. The result refers to the member in `D`’s
|
| 23 |
+
instance of `B`. Since the result has type “pointer to member of `D` of
|
| 24 |
+
type cv `T`”, indirection through it with a `D` object is valid. The
|
| 25 |
+
result is the same as if indirecting through the pointer to member of
|
| 26 |
+
`B` with the `B` subobject of `D`. The null member pointer value is
|
| 27 |
+
converted to the null member pointer value of the destination type.[^8]
|
|
|
|
| 28 |
|