tmp/tmpnd8rwenr/{from.md → to.md}
RENAMED
|
@@ -5,39 +5,41 @@ values. A type `P` meets the requirements of `NullablePointer` if:
|
|
| 5 |
|
| 6 |
- `P` satisfies the requirements of `EqualityComparable`,
|
| 7 |
`DefaultConstructible`, `CopyConstructible`, `CopyAssignable`, and
|
| 8 |
`Destructible`,
|
| 9 |
- lvalues of type `P` are swappable ([[swappable.requirements]]),
|
| 10 |
-
- the expressions shown in Table [[nullablepointer]] are valid and
|
| 11 |
-
the indicated semantics, and
|
| 12 |
- `P` satisfies 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 |
|
| 19 |
An object `p` of type `P` can be contextually converted to `bool`
|
| 20 |
(Clause [[conv]]). The effect shall be as if `p != nullptr` had been
|
| 21 |
evaluated in place of `p`.
|
| 22 |
|
| 23 |
No operation which is part of the `NullablePointer` requirements shall
|
| 24 |
exit via an exception.
|
| 25 |
|
| 26 |
-
In Table [[nullablepointer]], `u` denotes an identifier, `t`
|
| 27 |
-
non-`const` lvalue of type `P`, `a` and `b` denote values of
|
| 28 |
-
(possibly `const`) `P`, and `np` denotes a value of type (possibly
|
| 29 |
`const`) `std::nullptr_t`.
|
| 30 |
|
| 31 |
**Table: `NullablePointer` requirements** <a id="nullablepointer">[nullablepointer]</a>
|
| 32 |
|
| 33 |
| | | |
|
| 34 |
-
| -------------- | ---------------------------------- | ------------------------ |
|
| 35 |
-
| `P u(np);`<br> | |
|
| 36 |
| `P u = np;` | | |
|
| 37 |
-
| `P(np)` | |
|
| 38 |
-
| `t = np` | `P&` |
|
| 39 |
| `a != b` | contextually convertible to `bool` | `!(a == b)` |
|
| 40 |
| `a == np` | contextually convertible to `bool` | `a == P()` |
|
| 41 |
| `np == a` | | |
|
| 42 |
| `a != np` | contextually convertible to `bool` | `!(a == np)` |
|
| 43 |
| `np != a` | | |
|
|
|
|
| 5 |
|
| 6 |
- `P` satisfies the requirements of `EqualityComparable`,
|
| 7 |
`DefaultConstructible`, `CopyConstructible`, `CopyAssignable`, and
|
| 8 |
`Destructible`,
|
| 9 |
- lvalues of type `P` are swappable ([[swappable.requirements]]),
|
| 10 |
+
- the expressions shown in Table [[tab:nullablepointer]] are valid and
|
| 11 |
+
have the indicated semantics, and
|
| 12 |
- `P` satisfies 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 |
(Clause [[conv]]). The effect shall be as if `p != nullptr` had been
|
| 23 |
evaluated in place of `p`.
|
| 24 |
|
| 25 |
No operation which is part of the `NullablePointer` requirements shall
|
| 26 |
exit via an exception.
|
| 27 |
|
| 28 |
+
In Table [[tab:nullablepointer]], `u` denotes an identifier, `t`
|
| 29 |
+
denotes a non-`const` lvalue of type `P`, `a` and `b` denote values of
|
| 30 |
+
type (possibly `const`) `P`, and `np` denotes a value of type (possibly
|
| 31 |
`const`) `std::nullptr_t`.
|
| 32 |
|
| 33 |
**Table: `NullablePointer` requirements** <a id="nullablepointer">[nullablepointer]</a>
|
| 34 |
|
| 35 |
| | | |
|
| 36 |
+
| -------------- | ---------------------------------- | ---------------------------------- |
|
| 37 |
+
| `P u(np);`<br> | | Postconditions: `u == nullptr` |
|
| 38 |
| `P u = np;` | | |
|
| 39 |
+
| `P(np)` | | Postconditions: `P(np) == nullptr` |
|
| 40 |
+
| `t = np` | `P&` | Postconditions: `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` | | |
|