From Jason Turner

[expected.void.eq]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp0lr_cug1/{from.md → to.md} +24 -0
tmp/tmp0lr_cug1/{from.md → to.md} RENAMED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Equality operators <a id="expected.void.eq">[[expected.void.eq]]</a>
2
+
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 expression `x.error() == y.error()` is well-formed and
9
+ its result is convertible to `bool`.
10
+
11
+ *Returns:* If `x.has_value()` does not equal `y.has_value()`, `false`;
12
+ otherwise `x.has_value() || static_cast<bool>(x.error() == y.error())`.
13
+
14
+ ``` cpp
15
+ template<class E2>
16
+ friend constexpr bool operator==(const expected& x, const unexpected<E2>& e);
17
+ ```
18
+
19
+ *Mandates:* The expression `x.error() == e.error()` is well-formed and
20
+ its result is convertible to `bool`.
21
+
22
+ *Returns:*
23
+ `!x.has_value() && static_cast<bool>(x.error() == e.error())`.
24
+