tmp/tmpimsr2n3m/{from.md → to.md}
RENAMED
|
@@ -1,45 +1,45 @@
|
|
| 1 |
-
####
|
| 2 |
|
| 3 |
-
A
|
| 4 |
-
values. A type `P` meets the requirements
|
| 5 |
|
| 6 |
-
- `P`
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
- lvalues of type `P` are swappable
|
| 10 |
-
- the expressions shown in
|
| 11 |
-
|
| 12 |
-
- `P`
|
| 13 |
|
| 14 |
A value-initialized object of type `P` produces the null value of the
|
| 15 |
type. The null value shall be equivalent only to itself. A
|
| 16 |
default-initialized object of type `P` may have an indeterminate value.
|
| 17 |
|
| 18 |
[*Note 1*: Operations involving indeterminate values may cause
|
| 19 |
undefined behavior. — *end note*]
|
| 20 |
|
| 21 |
An object `p` of type `P` can be contextually converted to `bool`
|
| 22 |
-
|
| 23 |
-
|
| 24 |
|
| 25 |
-
No operation which is part of the
|
| 26 |
-
exit via an exception.
|
| 27 |
|
| 28 |
-
In
|
| 29 |
-
|
| 30 |
-
|
| 31 |
`const`) `std::nullptr_t`.
|
| 32 |
|
| 33 |
-
**Table:
|
| 34 |
|
| 35 |
-
|
|
| 36 |
-
| -------------- | ---------------------------------- | ---------------------------
|
| 37 |
-
| `P u(np);`<br> | |
|
| 38 |
| `P u = np;` | | |
|
| 39 |
-
| `P(np)` | |
|
| 40 |
-
| `t = np` | `P&` |
|
| 41 |
| `a != b` | contextually convertible to `bool` | `!(a == b)` |
|
| 42 |
| `a == np` | contextually convertible to `bool` | `a == P()` |
|
| 43 |
| `np == a` | | |
|
| 44 |
| `a != np` | contextually convertible to `bool` | `!(a == np)` |
|
| 45 |
| `np != a` | | |
|
|
|
|
| 1 |
+
#### *Cpp17NullablePointer* requirements <a id="nullablepointer.requirements">[[nullablepointer.requirements]]</a>
|
| 2 |
|
| 3 |
+
A *Cpp17NullablePointer* type is a pointer-like type that supports null
|
| 4 |
+
values. A type `P` meets the *Cpp17NullablePointer* requirements if:
|
| 5 |
|
| 6 |
+
- `P` meets the *Cpp17EqualityComparable*, *Cpp17DefaultConstructible*,
|
| 7 |
+
*Cpp17CopyConstructible*, *Cpp17CopyAssignable*, and
|
| 8 |
+
*Cpp17Destructible* requirements,
|
| 9 |
+
- lvalues of type `P` are swappable [[swappable.requirements]],
|
| 10 |
+
- the expressions shown in [[cpp17.nullablepointer]] are valid and have
|
| 11 |
+
the indicated semantics, and
|
| 12 |
+
- `P` meets all the other requirements of this subclause.
|
| 13 |
|
| 14 |
A value-initialized object of type `P` produces the null value of the
|
| 15 |
type. The null value shall be equivalent only to itself. A
|
| 16 |
default-initialized object of type `P` may have an indeterminate value.
|
| 17 |
|
| 18 |
[*Note 1*: Operations involving indeterminate values may cause
|
| 19 |
undefined behavior. — *end note*]
|
| 20 |
|
| 21 |
An object `p` of type `P` can be contextually converted to `bool`
|
| 22 |
+
[[conv]]. The effect shall be as if `p != nullptr` had been evaluated in
|
| 23 |
+
place of `p`.
|
| 24 |
|
| 25 |
+
No operation which is part of the *Cpp17NullablePointer* requirements
|
| 26 |
+
shall exit via an exception.
|
| 27 |
|
| 28 |
+
In [[cpp17.nullablepointer]], `u` denotes an identifier, `t` denotes a
|
| 29 |
+
non-`const` lvalue of type `P`, `a` and `b` denote values of type
|
| 30 |
+
(possibly `const`) `P`, and `np` denotes a value of type (possibly
|
| 31 |
`const`) `std::nullptr_t`.
|
| 32 |
|
| 33 |
+
**Table: Cpp17NullablePointer requirements** <a id="cpp17.nullablepointer">[cpp17.nullablepointer]</a>
|
| 34 |
|
| 35 |
+
| Expression | Return type | Operational semantics |
|
| 36 |
+
| -------------- | ---------------------------------- | --------------------------- |
|
| 37 |
+
| `P u(np);`<br> | | Ensures: `u == nullptr` |
|
| 38 |
| `P u = np;` | | |
|
| 39 |
+
| `P(np)` | | Ensures: `P(np) == nullptr` |
|
| 40 |
+
| `t = np` | `P&` | Ensures: `t == nullptr` |
|
| 41 |
| `a != b` | contextually convertible to `bool` | `!(a == b)` |
|
| 42 |
| `a == np` | contextually convertible to `bool` | `a == P()` |
|
| 43 |
| `np == a` | | |
|
| 44 |
| `a != np` | contextually convertible to `bool` | `!(a == np)` |
|
| 45 |
| `np != a` | | |
|