tmp/tmpf2y4sru8/{from.md → to.md}
RENAMED
|
@@ -1,30 +1,30 @@
|
|
| 1 |
-
## Pointer conversions <a id="conv.ptr">[[conv.ptr]]</a>
|
| 2 |
|
| 3 |
-
A *null pointer constant* is an integer literal
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
value of object pointer or function pointer type. Such a conversion is
|
| 8 |
called a *null pointer conversion*. Two null pointer values of the same
|
| 9 |
type shall compare equal. The conversion of a null pointer constant to a
|
| 10 |
pointer to cv-qualified type is a single conversion, and not the
|
| 11 |
-
sequence of a pointer conversion followed by a qualification
|
| 12 |
-
|
| 13 |
-
|
| 14 |
|
| 15 |
[*Note 1*: The resulting prvalue is not a null pointer
|
| 16 |
value. — *end note*]
|
| 17 |
|
| 18 |
-
A prvalue of type “pointer to
|
| 19 |
-
|
| 20 |
-
|
| 21 |
|
| 22 |
-
A prvalue of type “pointer to
|
| 23 |
-
be converted to a prvalue of type “pointer to
|
| 24 |
-
base class
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
|
|
|
|
| 1 |
+
### Pointer conversions <a id="conv.ptr">[[conv.ptr]]</a>
|
| 2 |
|
| 3 |
+
A *null pointer constant* is an integer literal [[lex.icon]] with value
|
| 4 |
+
zero or a prvalue of type `std::nullptr_t`. A null pointer constant can
|
| 5 |
+
be converted to a pointer type; the result is the null pointer value of
|
| 6 |
+
that type [[basic.compound]] and is distinguishable from every other
|
| 7 |
value of object pointer or function pointer type. Such a conversion is
|
| 8 |
called a *null pointer conversion*. Two null pointer values of the same
|
| 9 |
type shall compare equal. The conversion of a null pointer constant to a
|
| 10 |
pointer to cv-qualified type is a single conversion, and not the
|
| 11 |
+
sequence of a pointer conversion followed by a qualification conversion
|
| 12 |
+
[[conv.qual]]. A null pointer constant of integral type can be converted
|
| 13 |
+
to a prvalue of type `std::nullptr_t`.
|
| 14 |
|
| 15 |
[*Note 1*: The resulting prvalue is not a null pointer
|
| 16 |
value. — *end note*]
|
| 17 |
|
| 18 |
+
A prvalue of type “pointer to cv `T`”, where `T` is an object type, can
|
| 19 |
+
be converted to a prvalue of type “pointer to cv `void`”. The pointer
|
| 20 |
+
value [[basic.compound]] is unchanged by this conversion.
|
| 21 |
|
| 22 |
+
A prvalue of type “pointer to cv `D`”, where `D` is a complete class
|
| 23 |
+
type, can be converted to a prvalue of type “pointer to cv `B`”, where
|
| 24 |
+
`B` is a base class [[class.derived]] of `D`. If `B` is an inaccessible
|
| 25 |
+
[[class.access]] or ambiguous [[class.member.lookup]] base class of `D`,
|
| 26 |
+
a program that necessitates this conversion is ill-formed. The result of
|
| 27 |
+
the conversion is a pointer to the base class subobject of the derived
|
| 28 |
+
class object. The null pointer value is converted to the null pointer
|
| 29 |
+
value of the destination type.
|
| 30 |
|