Skip to content

Commit

Permalink
expected : C++26対応として比較演算子の適格要件をテンプレートパラメータ制約に変更 (close #1379)
Browse files Browse the repository at this point in the history
  • Loading branch information
faithandbrave committed Feb 28, 2025
1 parent debf1bd commit 94b8b36
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion reference/expected/expected.void/op_equal.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ friend constexpr bool operator==(const unexpected<E2>& e, const expected& x);
- (2), (3) : `expected`オブジェクトとエラー値の等値比較を行う。
## 適格要件
## テンプレートパラメータ制約
- (1) : 式`x.`[`error()`](error.md) `== y.`[`error()`](error.md)が適格であり、その結果を`bool`へ変換可能であること。
- (2), (3) : 式`x.`[`error()`](error.md) `== e.`[`error()`](../unexpected/error.md)が適格であり、その結果を`bool`へ変換可能であること。
Expand Down Expand Up @@ -80,3 +80,5 @@ int main()

## 参照
- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html)
- [P3379R0 Constrain `std::expected` equality operators](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3379r0.html)
- C++26で「適格要件」を「テンプレートパラメータ制約」に変更
4 changes: 3 additions & 1 deletion reference/expected/expected.void/op_not_equal.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ friend constexpr bool operator!=(const unexpected<E2>& e, const expected& x);
- (2), (3) : `expected`オブジェクトとエラー値の非等値比較を行う。
## 適格要件
## テンプレートパラメータ制約
- (1) : 式`x.`[`error()`](error.md) `== y.`[`error()`](error.md)が適格であり、その結果を`bool`へ変換可能であること。
- (2), (3) : 式`x.`[`error()`](error.md) `== e.`[`error()`](../unexpected/error.md)が適格であり、その結果を`bool`へ変換可能であること。
Expand Down Expand Up @@ -79,3 +79,5 @@ int main()

## 参照
- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html)
- [P3379R0 Constrain `std::expected` equality operators](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3379r0.html)
- C++26で「適格要件」を「テンプレートパラメータ制約」に変更
4 changes: 3 additions & 1 deletion reference/expected/expected/op_equal.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ friend constexpr bool operator==(const unexpected<E2>& e, const expected& x); //
- (4), (5) : `expected`オブジェクトとエラー値の等値比較を行う。
## 適格要件
## テンプレートパラメータ制約
- (1) : 式[`*x`](op_deref.md) `==` [`*y`](op_deref.md)および式`x.`[`error()`](error.md) `== y.`[`error()`](error.md)が適格であり、各式の結果を`bool`へ変換可能であること。
- (2), (3) : 式[`*x`](op_deref.md) `== v`が適格であり、その結果を`bool`へ変換可能であること。
- (4), (5) : 式`x.`[`error()`](error.md) `== e.`[`error()`](../unexpected/error.md)が適格であり、その結果を`bool`へ変換可能であること。
Expand Down Expand Up @@ -93,3 +93,5 @@ int main()

## 参照
- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html)
- [P3379R0 Constrain `std::expected` equality operators](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3379r0.html)
- C++26で「適格要件」を「テンプレートパラメータ制約」に変更
4 changes: 3 additions & 1 deletion reference/expected/expected/op_not_equal.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ friend constexpr bool operator!=(const unexpected<E2>& e, const expected& x); //
- (4), (5) : `expected`オブジェクトとエラー値の非等値比較を行う。
## 適格要件
## テンプレートパラメータ制約
- (1) : 式[`*x`](op_deref.md) `==` [`*y`](op_deref.md)および式`x.`[`error()`](error.md) `== y.`[`error()`](error.md)が適格であり、各式の結果を`bool`へ変換可能であること。
- (2), (3) : 式[`*x`](op_deref.md) `== v`が適格であり、その結果を`bool`へ変換可能であること。
- (4), (5) : 式`x.`[`error()`](error.md) `== e.`[`error()`](../unexpected/error.md)が適格であり、その結果を`bool`へ変換可能であること。
Expand Down Expand Up @@ -90,3 +90,5 @@ int main()

## 参照
- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html)
- [P3379R0 Constrain `std::expected` equality operators](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3379r0.html)
- C++26で「適格要件」を「テンプレートパラメータ制約」に変更

0 comments on commit 94b8b36

Please sign in to comment.