From Jason Turner

[expected.object.eq]

Diff to HTML by rtfpessoa

tmp/tmp2s257f96/{from.md → to.md} RENAMED
@@ -3,33 +3,34 @@
3
  ``` cpp
4
  template<class T2, class E2> requires (!is_void_v<T2>)
5
  friend constexpr bool operator==(const expected& x, const expected<T2, E2>& y);
6
  ```
7
 
8
- *Mandates:* The expressions `*x == *y` and `x.error() == y.error()` are
9
- well-formed and their results are convertible to `bool`.
10
 
11
  *Returns:* If `x.has_value()` does not equal `y.has_value()`, `false`;
12
  otherwise if `x.has_value()` is `true`, `*x == *y`; otherwise
13
  `x.error() == y.error()`.
14
 
15
  ``` cpp
16
  template<class T2> friend constexpr bool operator==(const expected& x, const T2& v);
17
  ```
18
 
19
- *Mandates:* The expression `*x == v` is well-formed and its result is
20
- convertible to `bool`.
 
21
 
22
  [*Note 1*: `T` need not be *Cpp17EqualityComparable*. — *end note*]
23
 
24
  *Returns:* `x.has_value() && static_cast<bool>(*x == v)`.
25
 
26
  ``` cpp
27
  template<class E2> friend constexpr bool operator==(const expected& x, const unexpected<E2>& e);
28
  ```
29
 
30
- *Mandates:* The expression `x.error() == e.error()` is well-formed and
31
- its result is convertible to `bool`.
32
 
33
  *Returns:*
34
  `!x.has_value() && static_cast<bool>(x.error() == e.error())`.
35
 
 
3
  ``` cpp
4
  template<class T2, class E2> requires (!is_void_v<T2>)
5
  friend constexpr bool operator==(const expected& x, const expected<T2, E2>& y);
6
  ```
7
 
8
+ *Constraints:* The expressions `*x == *y` and `x.error() == y.error()`
9
+ are well-formed and their results are convertible to `bool`.
10
 
11
  *Returns:* If `x.has_value()` does not equal `y.has_value()`, `false`;
12
  otherwise if `x.has_value()` is `true`, `*x == *y`; otherwise
13
  `x.error() == y.error()`.
14
 
15
  ``` cpp
16
  template<class T2> friend constexpr bool operator==(const expected& x, const T2& v);
17
  ```
18
 
19
+ *Constraints:* `T2` is not a specialization of `expected`. The
20
+ expression `*x == v` is well-formed and its result is convertible to
21
+ `bool`.
22
 
23
  [*Note 1*: `T` need not be *Cpp17EqualityComparable*. — *end note*]
24
 
25
  *Returns:* `x.has_value() && static_cast<bool>(*x == v)`.
26
 
27
  ``` cpp
28
  template<class E2> friend constexpr bool operator==(const expected& x, const unexpected<E2>& e);
29
  ```
30
 
31
+ *Constraints:* The expression `x.error() == e.error()` is well-formed
32
+ and its result is convertible to `bool`.
33
 
34
  *Returns:*
35
  `!x.has_value() && static_cast<bool>(x.error() == e.error())`.
36