From Jason Turner

[nullablepointer.requirements]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpnd8rwenr/{from.md → to.md} +12 -10
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 have
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
- Operations involving indeterminate values may cause undefined behavior.
 
 
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` denotes a
27
- non-`const` lvalue of type `P`, `a` and `b` denote values of type
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> | | post: `u == nullptr` |
36
  | `P u = np;` | | |
37
- | `P(np)` | | post: `P(np) == nullptr` |
38
- | `t = np` | `P&` | post: `t == nullptr` |
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` | | |