File tree Expand file tree Collapse file tree 21 files changed +406
-26
lines changed
expected/bad_expected_access Expand file tree Collapse file tree 21 files changed +406
-26
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,8 @@ const auto d = hello("Adolph Blaine Charles David Earl Frederick Gerald Hubert I
5454- [`std::bad_array_new_length`](/reference/new/bad_array_new_length.md)
5555- [`std::bad_cast`](/reference/typeinfo/bad_cast.md)
5656- [`std::bad_typeid`](/reference/typeinfo/bad_typeid.md)
57+ - [`<stdexcept>`](/reference/stdexcept.md)
58+ - [`std::bad_expected_access`](/reference/expected/bad_expected_access.md)
5759
5860
5961## 参照
Original file line number Diff line number Diff line change 66* cpp23[ meta cpp]
77
88``` cpp
9- constexpr const E& error () const & noexcept ; // (1)
10- constexpr E& error () & noexcept ; // (2)
11- constexpr const E&& error() const && noexcept ; // (3)
12- constexpr E&& error() && noexcept ; // (4)
9+ const E& error () const & noexcept ; // (1) C++23
10+ constexpr const E& error () const & noexcept ; // (1) C++26
11+
12+ E& error () & noexcept ; // (2) C++23
13+ constexpr E& error () & noexcept ; // (2) C++26
14+
15+ const E&& error() const && noexcept ; // (3) C++23
16+ constexpr const E&& error() const && noexcept ; // (3) C++26
17+
18+ E&& error() && noexcept ; // (4) C++23
19+ constexpr E&& error() && noexcept ; // (4) C++26
1320```
1421
1522## 概要
@@ -66,6 +73,12 @@ throw:ERR
6673- [ Visual C++] ( /implementation.md#visual_cpp ) : ??
6774
6875
76+ ## 関連項目
77+ - [ C++26 定数評価での例外送出を許可] ( /lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md )
78+
79+
6980## 参照
7081- [ P0323R12 std::expected] ( https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html )
7182- [ P2549R1 ` std::unexpected<E> ` should have ` error() ` as member accessor] ( https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2549r1.html )
83+ - [ P3378R2 ` constexpr ` exception types] ( https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3378r2.html )
84+ - C++26で` constexpr ` 対応した
Original file line number Diff line number Diff line change 66* cpp23[ meta cpp]
77
88``` cpp
9- explicit bad_expected_access (E e); // (1)
10- bad_expected_access(const bad_expected_access&); // (2)
11- bad_expected_access(bad_expected_access&&); // (3)
9+ explicit bad_expected_access (E e); // (1) C++23
10+ constexpr explicit bad_expected_access(E e); // (1) C++26
11+
12+ bad_expected_access(const bad_expected_access&); // (2) C++23
13+ constexpr bad_expected_access(const bad_expected_access&); // (2) C++26
14+
15+ bad_expected_access(bad_expected_access&&); // (3) C++23
16+ constexpr bad_expected_access(bad_expected_access&&); // (3) C++26
1217```
1318* bad_expected_access[link ../bad_expected_access.md]
1419
@@ -48,5 +53,11 @@ int main()
4853- [ Visual C++] ( /implementation.md#visual_cpp ) : ??
4954
5055
56+ ## 関連項目
57+ - [ C++26 定数評価での例外送出を許可] ( /lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md )
58+
59+
5160## 参照
5261- [ P0323R12 std::expected] ( https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html )
62+ - [ P3378R2 ` constexpr ` exception types] ( https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3378r2.html )
63+ - C++26で` constexpr ` 対応した
Original file line number Diff line number Diff line change 66* cpp23[ meta cpp]
77
88``` cpp
9- const char * what () const noexcept override ;
9+ const char * what () const noexcept override ; // (1) C++23
10+ constexpr const char * what () const noexcept override ; // (1) C++26
1011```
1112
1213## 概要
@@ -60,5 +61,11 @@ bad access to std::expected without expected value
6061- [ Visual C++] ( /implementation.md#visual_cpp ) : ??
6162
6263
64+ ## 関連項目
65+ - [ C++26 定数評価での例外送出を許可] ( /lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md )
66+
67+
6368## 参照
6469- [ P0323R12 std::expected] ( https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html )
70+ - [ P3378R2 ` constexpr ` exception types] ( https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3378r2.html )
71+ - C++26で` constexpr ` 対応した
Original file line number Diff line number Diff line change 66
77``` cpp
88namespace std {
9- class format_error : public runtime_error {
10- public:
11- explicit format_error(const string& what_arg);
12- explicit format_error(const char* what_arg);
13- };
9+ class format_error : public runtime_error;
1410}
1511```
16- * string[link /reference/string/basic_string.md]
1712
1813## 概要
1914`<format>`の各機能の失敗を表す例外クラス。ユーザー定義フォーマッターもこの例外を投げることができる。
2015
2116## メンバ関数
2217### 構築・破棄
2318
24- | 名前 | 説明 | 対応バージョン |
25- |-----------------|----------------|----------------|
26- | `(constructor)` | コンストラクタ | C++20 |
19+ | 名前 | 説明 | 対応バージョン |
20+ |------|------|----------------|
21+ | [(constructor)](format_error/op_constructor.md) | コンストラクタ | C++20 |
22+ | [(destructor)](format_error/op_destructor.md) | デストラクタ | C++20 |
23+ | [`operator=`](format_error/op_assign.md) | 代入演算子 | C++20 |
24+ | [`what`](format_error/what.md) | エラー理由を取得する | C++20 |
25+
2726
2827## バージョン
2928### 言語
Original file line number Diff line number Diff line change 1+ # operator=
2+ * format[ meta header]
3+ * std[ meta namespace]
4+ * format_error[ meta class]
5+ * function[ meta id-type]
6+ * cpp20[ meta cpp]
7+
8+ ``` cpp
9+ format_error& operator =(const format_error&) noexcept ; // (1) C++20
10+ constexpr format_error& operator =(const format_error&) noexcept ; // (1) C++26
11+ ```
12+
13+ ## 概要
14+ ` format_error ` オブジェクトを代入する
15+
16+ - (1) : コピー代入
17+
18+
19+ ## 例外
20+ 投げない
21+
22+
23+ ## 関連項目
24+ - [ C++26 定数評価での例外送出を許可] ( /lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md )
25+
26+
27+ ## 参照
28+ - [ P3378R2 ` constexpr ` exception types] ( https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3378r2.html )
29+ - C++26で` constexpr ` 対応した
Original file line number Diff line number Diff line change 1+ # コンストラクタ
2+ * format[ meta header]
3+ * std[ meta namespace]
4+ * format_error[ meta class]
5+ * function[ meta id-type]
6+ * cpp20[ meta cpp]
7+
8+ ``` cpp
9+ explicit format_error (const string& what_arg); // (1) C++20
10+ constexpr explicit format_error(const string& what_arg); // (1) C++26
11+
12+ explicit format_error(const char* what_arg); // (2) C++20
13+ constexpr explicit format_error(const char* what_arg); // (2) C++26
14+ ```
15+
16+ ## 概要
17+ `format_error`オブジェクトを構築する。
18+
19+ - (1) : `std::string`オブジェクトでエラー理由を受け取る
20+ - (2) : `const char*`でエラー理由を受け取る
21+
22+
23+ ## 事後条件
24+
25+ - (1) : `strcmp(what(), what_arg.c_str()) == 0`
26+ - (2) : `strcmp(what(), what_arg) == 0`
27+
28+
29+ ## 関連項目
30+ - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md)
31+
32+
33+ ## 参照
34+ - [P3378R2 `constexpr` exception types](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3378r2.html)
35+ - C++26で`constexpr`対応した
Original file line number Diff line number Diff line change 1+ # デストラクタ
2+ * format[ meta header]
3+ * std[ meta namespace]
4+ * format_error[ meta class]
5+ * function[ meta id-type]
6+ * cpp20[ meta cpp]
7+
8+ ``` cpp
9+ virtual ~format_error (); // (1) C++20
10+ constexpr virtual ~format_error (); // (1) C++26
11+ ```
12+
13+ ## 概要
14+ ` format_error ` オブジェクトを破棄する。
15+
16+
17+ ## 例外
18+ 投げない
19+
20+
21+ ## 関連項目
22+ - [ C++26 定数評価での例外送出を許可] ( /lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md )
23+
Original file line number Diff line number Diff line change 1+ # what
2+ * format[ meta header]
3+ * std[ meta namespace]
4+ * format_error[ meta class]
5+ * function[ meta id-type]
6+ * cpp20[ meta cpp]
7+
8+ ``` cpp
9+ const char * what () const noexcept override ; // (1) C++20
10+ constexpr const char * what () const noexcept override ; // (1) C++26
11+ ```
12+
13+ ## 概要
14+ エラー理由となる実装依存文字列を取得する。
15+
16+
17+ ## 例外
18+ 投げない
19+
20+
21+ ## 関連項目
22+ - [ C++26 定数評価での例外送出を許可] ( /lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md )
23+
24+
25+ ## 参照
26+ - [ P3378R2 ` constexpr ` exception types] ( https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3378r2.html )
27+ - C++26で` constexpr ` 対応した
Original file line number Diff line number Diff line change 66* cpp11[ meta cpp]
77
88``` cpp
9- virtual ~bad_array_new_length (); // (1) C++03
9+ virtual ~bad_array_new_length (); // (1) C++11
1010constexpr virtual ~bad_array_new_length (); // (1) C++26
1111```
1212
You can’t perform that action at this time.
0 commit comments