From Jason Turner

[optional.relops]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpyrg4501m/{from.md → to.md} +30 -19
tmp/tmpyrg4501m/{from.md → to.md} RENAMED
@@ -2,81 +2,92 @@
2
 
3
  ``` cpp
4
  template<class T, class U> constexpr bool operator==(const optional<T>& x, const optional<U>& y);
5
  ```
6
 
7
- *Requires:* The expression `*x == *y` shall be well-formed and its
8
- result shall be convertible to `bool`.
9
 
10
- [*Note 1*: `T` need not be `EqualityComparable`. — *end note*]
11
 
12
  *Returns:* If `bool(x) != bool(y)`, `false`; otherwise if
13
  `bool(x) == false`, `true`; otherwise `*x == *y`.
14
 
15
  *Remarks:* Specializations of this function template for which
16
- `*x == *y` is a core constant expression shall be constexpr functions.
17
 
18
  ``` cpp
19
  template<class T, class U> constexpr bool operator!=(const optional<T>& x, const optional<U>& y);
20
  ```
21
 
22
- *Requires:* The expression `*x != *y` shall be well-formed and its
23
- result shall be convertible to `bool`.
24
 
25
  *Returns:* If `bool(x) != bool(y)`, `true`; otherwise, if
26
  `bool(x) == false`, `false`; otherwise `*x != *y`.
27
 
28
  *Remarks:* Specializations of this function template for which
29
- `*x != *y` is a core constant expression shall be constexpr functions.
30
 
31
  ``` cpp
32
  template<class T, class U> constexpr bool operator<(const optional<T>& x, const optional<U>& y);
33
  ```
34
 
35
- *Requires:* `*x < *y` shall be well-formed and its result shall be
36
- convertible to `bool`.
37
 
38
  *Returns:* If `!y`, `false`; otherwise, if `!x`, `true`; otherwise
39
  `*x < *y`.
40
 
41
  *Remarks:* Specializations of this function template for which `*x < *y`
42
- is a core constant expression shall be constexpr functions.
43
 
44
  ``` cpp
45
  template<class T, class U> constexpr bool operator>(const optional<T>& x, const optional<U>& y);
46
  ```
47
 
48
- *Requires:* The expression `*x > *y` shall be well-formed and its result
49
- shall be convertible to `bool`.
50
 
51
  *Returns:* If `!x`, `false`; otherwise, if `!y`, `true`; otherwise
52
  `*x > *y`.
53
 
54
  *Remarks:* Specializations of this function template for which `*x > *y`
55
- is a core constant expression shall be constexpr functions.
56
 
57
  ``` cpp
58
  template<class T, class U> constexpr bool operator<=(const optional<T>& x, const optional<U>& y);
59
  ```
60
 
61
- *Requires:* The expression `*x <= *y` shall be well-formed and its
62
- result shall be convertible to `bool`.
63
 
64
  *Returns:* If `!x`, `true`; otherwise, if `!y`, `false`; otherwise
65
  `*x <= *y`.
66
 
67
  *Remarks:* Specializations of this function template for which
68
- `*x <= *y` is a core constant expression shall be constexpr functions.
69
 
70
  ``` cpp
71
  template<class T, class U> constexpr bool operator>=(const optional<T>& x, const optional<U>& y);
72
  ```
73
 
74
- *Requires:* The expression `*x >= *y` shall be well-formed and its
75
- result shall be convertible to `bool`.
76
 
77
  *Returns:* If `!y`, `true`; otherwise, if `!x`, `false`; otherwise
78
  `*x >= *y`.
79
 
80
  *Remarks:* Specializations of this function template for which
81
- `*x >= *y` is a core constant expression shall be constexpr functions.
 
 
 
 
 
 
 
 
 
 
 
82
 
 
2
 
3
  ``` cpp
4
  template<class T, class U> constexpr bool operator==(const optional<T>& x, const optional<U>& y);
5
  ```
6
 
7
+ *Mandates:* The expression `*x == *y` is well-formed and its result is
8
+ convertible to `bool`.
9
 
10
+ [*Note 1*: `T` need not be *Cpp17EqualityComparable*. — *end note*]
11
 
12
  *Returns:* If `bool(x) != bool(y)`, `false`; otherwise if
13
  `bool(x) == false`, `true`; otherwise `*x == *y`.
14
 
15
  *Remarks:* Specializations of this function template for which
16
+ `*x == *y` is a core constant expression are constexpr functions.
17
 
18
  ``` cpp
19
  template<class T, class U> constexpr bool operator!=(const optional<T>& x, const optional<U>& y);
20
  ```
21
 
22
+ *Mandates:* The expression `*x != *y` is well-formed and its result is
23
+ convertible to `bool`.
24
 
25
  *Returns:* If `bool(x) != bool(y)`, `true`; otherwise, if
26
  `bool(x) == false`, `false`; otherwise `*x != *y`.
27
 
28
  *Remarks:* Specializations of this function template for which
29
+ `*x != *y` is a core constant expression are constexpr functions.
30
 
31
  ``` cpp
32
  template<class T, class U> constexpr bool operator<(const optional<T>& x, const optional<U>& y);
33
  ```
34
 
35
+ *Mandates:* `*x < *y` is well-formed and its result is convertible to
36
+ `bool`.
37
 
38
  *Returns:* If `!y`, `false`; otherwise, if `!x`, `true`; otherwise
39
  `*x < *y`.
40
 
41
  *Remarks:* Specializations of this function template for which `*x < *y`
42
+ is a core constant expression are constexpr functions.
43
 
44
  ``` cpp
45
  template<class T, class U> constexpr bool operator>(const optional<T>& x, const optional<U>& y);
46
  ```
47
 
48
+ *Mandates:* The expression `*x > *y` is well-formed and its result is
49
+ convertible to `bool`.
50
 
51
  *Returns:* If `!x`, `false`; otherwise, if `!y`, `true`; otherwise
52
  `*x > *y`.
53
 
54
  *Remarks:* Specializations of this function template for which `*x > *y`
55
+ is a core constant expression are constexpr functions.
56
 
57
  ``` cpp
58
  template<class T, class U> constexpr bool operator<=(const optional<T>& x, const optional<U>& y);
59
  ```
60
 
61
+ *Mandates:* The expression `*x <= *y` is well-formed and its result is
62
+ convertible to `bool`.
63
 
64
  *Returns:* If `!x`, `true`; otherwise, if `!y`, `false`; otherwise
65
  `*x <= *y`.
66
 
67
  *Remarks:* Specializations of this function template for which
68
+ `*x <= *y` is a core constant expression are constexpr functions.
69
 
70
  ``` cpp
71
  template<class T, class U> constexpr bool operator>=(const optional<T>& x, const optional<U>& y);
72
  ```
73
 
74
+ *Mandates:* The expression `*x >= *y` is well-formed and its result is
75
+ convertible to `bool`.
76
 
77
  *Returns:* If `!y`, `true`; otherwise, if `!x`, `false`; otherwise
78
  `*x >= *y`.
79
 
80
  *Remarks:* Specializations of this function template for which
81
+ `*x >= *y` is a core constant expression are constexpr functions.
82
+
83
+ ``` cpp
84
+ template<class T, three_way_comparable_with<T> U>
85
+ constexpr compare_three_way_result_t<T,U>
86
+ operator<=>(const optional<T>& x, const optional<U>& y);
87
+ ```
88
+
89
+ *Returns:* If `x && y`, `*x <=> *y`; otherwise `bool(x) <=> bool(y)`.
90
+
91
+ *Remarks:* Specializations of this function template for which
92
+ `*x <=> *y` is a core constant expression are constexpr functions.
93