From Jason Turner

[variant.relops]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpe0r4y7eb/{from.md → to.md} +21 -19
tmp/tmpe0r4y7eb/{from.md → to.md} RENAMED
@@ -3,81 +3,83 @@
3
  ``` cpp
4
  template<class... Types>
5
  constexpr bool operator==(const variant<Types...>& v, const variant<Types...>& w);
6
  ```
7
 
8
- *Mandates:* `get<`i`>(v) == get<`i`>(w)` is a valid expression that is
9
- convertible to `bool`, for all i.
10
 
11
  *Returns:* If `v.index() != w.index()`, `false`; otherwise if
12
  `v.valueless_by_exception()`, `true`; otherwise
13
- `get<`i`>(v) == get<`i`>(w)` with i being `v.index()`.
14
 
15
  ``` cpp
16
  template<class... Types>
17
  constexpr bool operator!=(const variant<Types...>& v, const variant<Types...>& w);
18
  ```
19
 
20
- *Mandates:* `get<`i`>(v) != get<`i`>(w)` is a valid expression that is
21
- convertible to `bool`, for all i.
22
 
23
  *Returns:* If `v.index() != w.index()`, `true`; otherwise if
24
  `v.valueless_by_exception()`, `false`; otherwise
25
- `get<`i`>(v) != get<`i`>(w)` with i being `v.index()`.
26
 
27
  ``` cpp
28
  template<class... Types>
29
  constexpr bool operator<(const variant<Types...>& v, const variant<Types...>& w);
30
  ```
31
 
32
- *Mandates:* `get<`i`>(v) < get<`i`>(w)` is a valid expression that is
33
- convertible to `bool`, for all i.
34
 
35
  *Returns:* If `w.valueless_by_exception()`, `false`; otherwise if
36
  `v.valueless_by_exception()`, `true`; otherwise, if
37
  `v.index() < w.index()`, `true`; otherwise if `v.index() > w.index()`,
38
- `false`; otherwise `get<`i`>(v) < get<`i`>(w)` with i being `v.index()`.
 
39
 
40
  ``` cpp
41
  template<class... Types>
42
  constexpr bool operator>(const variant<Types...>& v, const variant<Types...>& w);
43
  ```
44
 
45
- *Mandates:* `get<`i`>(v) > get<`i`>(w)` is a valid expression that is
46
- convertible to `bool`, for all i.
47
 
48
  *Returns:* If `v.valueless_by_exception()`, `false`; otherwise if
49
  `w.valueless_by_exception()`, `true`; otherwise, if
50
  `v.index() > w.index()`, `true`; otherwise if `v.index() < w.index()`,
51
- `false`; otherwise `get<`i`>(v) > get<`i`>(w)` with i being `v.index()`.
 
52
 
53
  ``` cpp
54
  template<class... Types>
55
  constexpr bool operator<=(const variant<Types...>& v, const variant<Types...>& w);
56
  ```
57
 
58
- *Mandates:* `get<`i`>(v) <= get<`i`>(w)` is a valid expression that is
59
- convertible to `bool`, for all i.
60
 
61
  *Returns:* If `v.valueless_by_exception()`, `true`; otherwise if
62
  `w.valueless_by_exception()`, `false`; otherwise, if
63
  `v.index() < w.index()`, `true`; otherwise if `v.index() > w.index()`,
64
- `false`; otherwise `get<`i`>(v) <= get<`i`>(w)` with i being
65
  `v.index()`.
66
 
67
  ``` cpp
68
  template<class... Types>
69
  constexpr bool operator>=(const variant<Types...>& v, const variant<Types...>& w);
70
  ```
71
 
72
- *Mandates:* `get<`i`>(v) >= get<`i`>(w)` is a valid expression that is
73
- convertible to `bool`, for all i.
74
 
75
  *Returns:* If `w.valueless_by_exception()`, `true`; otherwise if
76
  `v.valueless_by_exception()`, `false`; otherwise, if
77
  `v.index() > w.index()`, `true`; otherwise if `v.index() < w.index()`,
78
- `false`; otherwise `get<`i`>(v) >= get<`i`>(w)` with i being
79
  `v.index()`.
80
 
81
  ``` cpp
82
  template<class... Types> requires (three_way_comparable<Types> && ...)
83
  constexpr common_comparison_category_t<compare_three_way_result_t<Types>...>
@@ -90,10 +92,10 @@ template<class... Types> requires (three_way_comparable<Types> && ...)
90
  if (v.valueless_by_exception() && w.valueless_by_exception())
91
  return strong_ordering::equal;
92
  if (v.valueless_by_exception()) return strong_ordering::less;
93
  if (w.valueless_by_exception()) return strong_ordering::greater;
94
  if (auto c = v.index() <=> w.index(); c != 0) return c;
95
- return get<i>(v) <=> get<i>(w);
96
  ```
97
 
98
  with i being `v.index()`.
99
 
 
3
  ``` cpp
4
  template<class... Types>
5
  constexpr bool operator==(const variant<Types...>& v, const variant<Types...>& w);
6
  ```
7
 
8
+ *Constraints:* *`GET`*`<`i`>(v) == `*`GET`*`<`i`>(w)` is a valid
9
+ expression that is convertible to `bool`, for all i.
10
 
11
  *Returns:* If `v.index() != w.index()`, `false`; otherwise if
12
  `v.valueless_by_exception()`, `true`; otherwise
13
+ *`GET`*`<`i`>(v) == `*`GET`*`<`i`>(w)` with i being `v.index()`.
14
 
15
  ``` cpp
16
  template<class... Types>
17
  constexpr bool operator!=(const variant<Types...>& v, const variant<Types...>& w);
18
  ```
19
 
20
+ *Constraints:* *`GET`*`<`i`>(v) != `*`GET`*`<`i`>(w)` is a valid
21
+ expression that is convertible to `bool`, for all i.
22
 
23
  *Returns:* If `v.index() != w.index()`, `true`; otherwise if
24
  `v.valueless_by_exception()`, `false`; otherwise
25
+ *`GET`*`<`i`>(v) != `*`GET`*`<`i`>(w)` with i being `v.index()`.
26
 
27
  ``` cpp
28
  template<class... Types>
29
  constexpr bool operator<(const variant<Types...>& v, const variant<Types...>& w);
30
  ```
31
 
32
+ *Constraints:* *`GET`*`<`i`>(v) < `*`GET`*`<`i`>(w)` is a valid
33
+ expression that is convertible to `bool`, for all i.
34
 
35
  *Returns:* If `w.valueless_by_exception()`, `false`; otherwise if
36
  `v.valueless_by_exception()`, `true`; otherwise, if
37
  `v.index() < w.index()`, `true`; otherwise if `v.index() > w.index()`,
38
+ `false`; otherwise *`GET`*`<`i`>(v) < `*`GET`*`<`i`>(w)` with i being
39
+ `v.index()`.
40
 
41
  ``` cpp
42
  template<class... Types>
43
  constexpr bool operator>(const variant<Types...>& v, const variant<Types...>& w);
44
  ```
45
 
46
+ *Constraints:* *`GET`*`<`i`>(v) > `*`GET`*`<`i`>(w)` is a valid
47
+ expression that is convertible to `bool`, for all i.
48
 
49
  *Returns:* If `v.valueless_by_exception()`, `false`; otherwise if
50
  `w.valueless_by_exception()`, `true`; otherwise, if
51
  `v.index() > w.index()`, `true`; otherwise if `v.index() < w.index()`,
52
+ `false`; otherwise *`GET`*`<`i`>(v) > `*`GET`*`<`i`>(w)` with i being
53
+ `v.index()`.
54
 
55
  ``` cpp
56
  template<class... Types>
57
  constexpr bool operator<=(const variant<Types...>& v, const variant<Types...>& w);
58
  ```
59
 
60
+ *Constraints:* *`GET`*`<`i`>(v) <= `*`GET`*`<`i`>(w)` is a valid
61
+ expression that is convertible to `bool`, for all i.
62
 
63
  *Returns:* If `v.valueless_by_exception()`, `true`; otherwise if
64
  `w.valueless_by_exception()`, `false`; otherwise, if
65
  `v.index() < w.index()`, `true`; otherwise if `v.index() > w.index()`,
66
+ `false`; otherwise *`GET`*`<`i`>(v) <= `*`GET`*`<`i`>(w)` with i being
67
  `v.index()`.
68
 
69
  ``` cpp
70
  template<class... Types>
71
  constexpr bool operator>=(const variant<Types...>& v, const variant<Types...>& w);
72
  ```
73
 
74
+ *Constraints:* *`GET`*`<`i`>(v) >= `*`GET`*`<`i`>(w)` is a valid
75
+ expression that is convertible to `bool`, for all i.
76
 
77
  *Returns:* If `w.valueless_by_exception()`, `true`; otherwise if
78
  `v.valueless_by_exception()`, `false`; otherwise, if
79
  `v.index() > w.index()`, `true`; otherwise if `v.index() < w.index()`,
80
+ `false`; otherwise *`GET`*`<`i`>(v) >= `*`GET`*`<`i`>(w)` with i being
81
  `v.index()`.
82
 
83
  ``` cpp
84
  template<class... Types> requires (three_way_comparable<Types> && ...)
85
  constexpr common_comparison_category_t<compare_three_way_result_t<Types>...>
 
92
  if (v.valueless_by_exception() && w.valueless_by_exception())
93
  return strong_ordering::equal;
94
  if (v.valueless_by_exception()) return strong_ordering::less;
95
  if (w.valueless_by_exception()) return strong_ordering::greater;
96
  if (auto c = v.index() <=> w.index(); c != 0) return c;
97
+ return GET<i>(v) <=> GET<i>(w);
98
  ```
99
 
100
  with i being `v.index()`.
101